3 ms·
Nanoid are really great. It is a smarter uuid4 with variable size and alphabet. It is also a lot faster to generate. See that: https://blog.bitsrc.io/why-is-na
by greatgib 5y ago
Nanoid are really great. It is a smarter uuid4 with variable size and alphabet. It is also a lot faster to generate.
See that:
https://blog.bitsrc.io/why-is-nanoid-replacing-uuid-1b5100e62ed2 https://blog.bitsrc.io/why-is-nanoid-replacing-uuid-1b5100e6...
By definition, if you base62 or base64 your uuid4 it will be longer (30%?).
This generate directly in the final encoding so it is a lot shorter.
Based on the simulator calculation, you just need 24 chars to be equivalent to an uuid4 that is 35 chars.
But being able to determine the length of the resulting id is one of the greatest feature. Did it never happened to you the case that you would like a shorter uuid4 and think that you can just truncate it? Not realizing that some parts of the uuid have a special meaning and are not random...