Universally Unique Identifier Version 9
The v9 UUID supports both sequential (time-based) and non-sequential (random) UUIDs with an optional prefix of up to four bytes, an optional checksum, and sufficient randomness to avoid collisions. It uses the UNIX timestamp for sequential UUIDs and CRC-8 for checksums. A version digit can be added if desired, but is omitted by default.
How it works.
The best way to explain the v9 UUID is with examples of its features. Even with all features enabled there are still five bytes of randomness (1610 possible values per millisecond).
Non-Sequential
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
x = random
Non-Sequential + Prefix
yyyyyyyy-xxxx-xxxx-xxxx-xxxxxxxxxxxx
x = random, y = prefix (optional)
Sequential
zzzzzzzz-zzzx-xxxx-xxxx-xxxxxxxxxxxx
x = random, z = timestamp (optional)
Sequential + Prefix + Checksum
yyyyyyyy-zzzz-zzzz-zzzx-xxxxxxxxxxcc
x = random, y = prefix (optional), z = timestamp (optional), c = checksum (optional)
Sequential + Prefix + Checksum + Version
yyyyyyyy-zzzz-9zzz-zzzz-xxxxxxxxxxcc
x = random, y = prefix (optional), z = timestamp (optional), c = checksum (optional), 9 = version (optional)
How to use it.
Zero-dependency implementations are available in JavaScript and Python with more on the way. For language requests or to suggest an improvement to an existing implementation please contact us.
We're here to help.
If you have comments, questions, or suggestions, or are interested in learning how to leverage the features of v9 UUIDs in your organization, please use this form to get in touch.