ZUID
Short, sortable, privacy-preserving unique identifiers.
A UUID is 36 characters, sorts meaninglessly, and is awkward to read over a phone. Most of the time that buys uniqueness nobody needed.
An identifier built from a timestamp and rendered in a compact base is far shorter, sorts in creation order as plain text, and is still unique enough for the job. When it is not, more can be mixed in - finer time precision, host, user, MAC, a UUID, or random data - until it is as unique as required. Every component is a fixed width, so identifiers line up in a column and split back into their parts by offset.
Base conversion is not reimplemented here. It comes from convert-base, so there is one definition of what a base means rather than two that can drift apart. The identifier spec itself has two independent implementations, one in Go and one in Zig, sharing a table of test vectors that both have to reproduce.
Highlights
- As short as necessary, but no shorter.
- Sorts by creation time, as text, with no special comparison function.
- Uniqueness is tunable, and paid for in length only where it is wanted.
- Private by default: host and user are hashed unless you ask otherwise.
- A curated set of bases suited to identifiers, with the full set of sixty-odd available.
- The Go and C modules are permissively licensed, so embedding one carries no obligation beyond attribution.