Time-ordered UUID version 7
03UUIDv7 begins with a 48-bit Unix-epoch millisecond timestamp.
Different millisecond prefixes sort by time; same-millisecond order depends on generation choices.
Key idea: The remaining 74 non-layout bits hold randomness and optionally supported monotonicity subfields.
Rules & examples
The remaining 74 non-layout bits hold randomness and optionally supported monotonicity subfields.
- The remaining 74 non-layout bits hold randomness and optionally supported monotonicity subfields.
- Multiple identifiers in one millisecond need careful generation state.
- A sortable timestamp is not a globally guaranteed creation order.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
Sources
New to this? Start hereA quick picture + helpful background
First, agree how to read the message.
An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.