paralleldrive / cuid

Collision-resistant ids optimized for horizontal scaling and performance.
Other
3.44k stars 123 forks source link

RegExp for validation? #50

Closed stockholmux closed 8 years ago

stockholmux commented 9 years ago

Is there a regular expression to validate CUIDs?

hilkeheremans commented 9 years ago

Check out https://github.com/smallhelm/is-cuid and https://www.npmjs.com/package/is-cuid

stockholmux commented 9 years ago

Nice! This should be in the readme for this project - I would have never found this without your help.

rsp commented 7 years ago

@stockholmux @hilkeheremans Note that is-cuid returns true for strings like this:

which I personally wouldn't consider a valid cuid.

See: https://runkit.com/rsp/59ba67877e8de600126d4b85

hilkeheremans commented 7 years ago

Yes, we noticed that as well recently. Thanks for mentioning!