graphql-scalars
graphql-scalars copied to clipboard
Add CUID scalar type
Could it be possible to add a cuid scalar type.
cuid
cjld2cyuq0000t3rmniod1foy
Broken down
c - h72gsb32 - 0000 - udoc - l363eofy
The groups (in order)
- 'c' - identifies this as a cuid, and allows you to use it in html entity ids.
- Timestamp
- Counter - a single process might generate the same random string. The weaker the pseudo-random source, the higher the probability. That problem gets worse as processors get faster. The counter will roll over if the value gets too big.
- Client fingerprint
- Random (using cryptographically secure libraries where available).
More info
https://github.com/ericelliott/cuid
That sounds cool! Would you create a draft PR for that so we can help you in advance?