paralleldrive / cuid

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

Make the starting symbol customizable #57

Closed maberer closed 8 years ago

maberer commented 8 years ago

Would be great to have a way to customize the starting character. It could be given as a parameter to the cuid() function. The "c" could be the default if not given...

If customizable, one could create specific classes of IDs that would allow some backend decisions based on the type of ID received...

ericelliott commented 8 years ago

In general, it's a bad idea to parse information out of identifiers -- you're really mixing concerns when you do so.

If you really must do something like that, you could easily wrap cuid and concatenate whatever you want to it.

maberer commented 8 years ago

ok thanks, trying to keep them pure.