Which is better?
These are UUIDs of similar (but not exactly the same) entropy. Why would we use Nfjh3z and 6416957, as almost every platform does?
There are better ways, let's learn a little 👇
I'll add my OSS implementation at the end
Nfjh3z
badod-vomut
29 cheap bees...merrily
6416957
Unique IDs are a fundamental part of the automated world. A uniquely id (with enough bits) makes savings things easier.
With sequential ids (1,2,3), there needs to be a central store making sure no two people get the same one. This works for license plates, or counting kids!
But if you use a large enough space, now you don't need to coordinate your ids - if you have a good enough source of randomness. The chances of a collision are very, VERY negligible.
Best example is BTC. Is there a chance you can generate satoshi's private key? Yes. Really? No.
This is why you see them everywhere. Zoom Meeting IDs, Notion pages, practically everywhere - hell the Github Gist I'm sharing below uses a uuid.
But this isn't an excuse to throw them at your users. Anyone who's held down left for hours to copy a MASSIVE URL will agree with me.
When possible, be kind to your users - their clipboards, their memories, their friends they want to share your stuff with. Make things easy to read, easy to remember, and easy to share.
It doesn't take much. Google Meet for example - just splits a 9-letter string with hyphens
Even just having the hypens (as opposed to ytocczyrqe) makes things easier.
But we can do better. The simple method is to have a dictionary of words, and just use them instead of numbers. We're better at those. Gfycat (and bitcoin secret words) are an example!
pypi.org/project/hruid (for python) and Greg (github.com/linus/greg/ for JS) use this approach, but they go one step further and mix adjectives and nouns in the right way to make them more memorable.
The inspiration came from Asana, in "6 sad squid snuggle softly"
A middle ground is github.com/unleashlive/human-readable-ids. You only get 1M ids, which is a little low, but they're very readable and copiable - you could read one out to a friend over the phone pretty easy.
But the best one for me has to be proquint.
Proquint (from Daniel Wilkerson), uses consonants and vowels to create easy to read nonexistent words with more info per letter. "badod-vomut" has 2^32 bits of entropy, which is enough for a small project or a UUID inside a user's space.
Worth the read: arxiv.org/html/0901.4016
Here's a typescript implementation that I've started using everywhere: gist.github.com/hrishioa/1d0452415c47eb0d6a8b78cc6ddc3f4b
You can add two more proquints for a little loss in readability but a full 64-bit address space - which might be all you need for your app!!