paralleldrive / cuid

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

Will cuid length always be 25? #51

Closed asafyish closed 8 years ago

asafyish commented 9 years ago

Hi,

Is cuid will always return a length 25 string ? Need to know for setting VARCHAR length. Couldn't find an exact answer about it.

Thanks !

ericelliott commented 9 years ago

Hi,

I'm not sure of the answer off the time of my head, but it shouldn't be possible for the length to vary more than 4 chars.

louisabraham commented 3 years ago

Hi, does it mean it will vary in [21, 25], [23, 27], [25, 29] or [21, 29] ?

MurzNN commented 3 years ago

Declared fixed length of cuid (eg 32 characters) will be greatly improve database performance, because storing and operating with cells, having fixed length (eg Char(32)), in database files, is much easier and quicker, than variable (VarChar(32)).

ericelliott commented 3 years ago

This standard is a decade old. We probably shouldn't go making changes that could break people's apps unless we have a really compelling reason to.