What is a UUIDv1?
UUIDv1 was one of the original UUID versions defined in RFC 4122. It combines a 60-bit timestamp (100-nanosecond intervals since October 15, 1582) with a 48-bit node identifier, typically derived from the host's MAC address.
The format is
xxxxxxxx-xxxx-1xxx-yxxx-nnnnnnnnnnnn,
where the 1
indicates version 1,
y
is the variant (8/9/a/b), and
n
positions contain the node (MAC address).
Considerations
- Privacy: The embedded MAC address can reveal the generating host's identity. Modern implementations often use random node IDs instead.
- Not naturally sortable: The timestamp bits are split across non-contiguous positions, so UUIDv1 does not sort chronologically as a string. UUIDv6 and UUIDv7 were created to address this.
- Legacy compatibility: UUIDv1 is still widely used in systems like Apache Cassandra, which uses it as a "TimeUUID" for time-ordered partitioning.
For new projects, consider UUIDv7 if you need time ordering, or UUIDv4 if you need pure randomness.
Frequently Asked Questions
- Does UUIDv1 expose my MAC address?
- The original specification uses the host's MAC address as the node ID (last 12 hex characters). Most modern libraries generate a random node ID instead to avoid this privacy concern.
- Is UUIDv1 still used in production?
- Yes. Apache Cassandra uses UUIDv1 as its "TimeUUID" type for time-ordered data. Many legacy systems also rely on v1 for backwards compatibility.
- Is my data sent to a server?
- No. UUIDs are generated and validated entirely in your browser. Nothing is sent to any server.