What does HackerNews think of nanoid?
A tiny (130 bytes), secure, URL-friendly, unique string ID generator for JavaScript
Language:
JavaScript
I usually go for Nano Id for new projects https://github.com/ai/nanoid
I’ve started using nanoid for generated ids. Here is the JavaScript version:
Some info from that page:
- Safe. It uses hardware random generator. Can be used in clusters.
- Short IDs. It uses a larger alphabet than UUID (A-Za-z0-9_-). So ID size was reduced from 36 to 21 symbols.
- Portable. Nano ID was ported to 20 programming languages.
Can someone clarify this statement from the original nanoID site (https://github.com/ai/nanoid) for me?
"random % alphabet is a popular mistake to make when coding an ID generator. The distribution will not be even; there will be a lower chance for some symbols to appear compared to others."
If random is picked such that it's in the range of alphabet (i.e. 0 to 25), then the bias should not exist, right? Is that what he's alluding to? Thanks in advance.
I really like https://github.com/ai/nanoid which is available for a wide range of programming languages. It creates short, random, and URL-safe IDs.