What is UUID v1?
UUID version 1 is a time-based 128-bit identifier (36-char string) from RFC 4122. It combines:
- Timestamp: 60-bit value (100-nanosecond precision since 1582-10-15)
- Clock sequence: 14-bit counter for clock adjustments
- Node ID: 48-bit value (typically MAC address)
Format example: 2ed6657d-e927-11eb-9a03-0242ac130003
How UUID v1 works
- Calculate current timestamp (100ns intervals since 1582-10-15)
- Get/increment 14-bit clock sequence (for uniqueness if clock moves backward)
- Obtain 48-bit node ID (usually from MAC address)
- Set version bits (0001) and variant bits (10)
- Assemble as 32 hex digits with hyphens: 8-4-4-4-12 format
Advantages & Considerations
Advantages | Considerations |
---|---|
|
|
UUID v1 Structure
Bits | Content |
---|---|
0-31 | Low 32 bits of timestamp |
32-47 | Middle 16 bits of timestamp |
48-59 | High 12 bits of timestamp |
60-63 | Version (0001 for v1) |
64-65 | Variant (10 for RFC4122) |
66-79 | Clock sequence (14 bits) |
80-127 | Node ID (48 bits) |
UUID v1 vs. other versions
Version | Based on | Use case | Privacy |
---|---|---|---|
UUID v1 | Time + MAC | Time-ordered IDs | ⚠️ Reveals MAC |
UUID v3 | Namespace + MD5 | Deterministic IDs | ✅ Private |
UUID v4 | Random | Secure random IDs | ✅ Private |
UUID v5 | Namespace + SHA-1 | Deterministic IDs | ✅ Private |
UUID v6 | Time (reordered) | Sortable IDs | ⚠️ Reveals MAC |
UUID v7 | Time + random | Sortable IDs | ✅ Private |
Common Use Cases
- Database keys: Distributed databases
- Audit logs: Time-ordered tracking
- Transaction IDs: Business processes
- Session tracking: Web applications
- Content addressing: CMS systems
- IoT messages: Device communication
Frequently Asked Questions
Is UUID v1 cryptographically secure?
No. UUID v1 is predictable if timestamp and MAC address are known. For security, use random UUID v4 instead.
Can UUID v1 values collide?
Collisions are extremely unlikely in practice due to timestamp precision, clock sequence counters, and node identifiers.
Can I extract the creation time from a UUID v1?
Yes. The timestamp component can be extracted with appropriate algorithms available in most UUID libraries.
Are UUIDs v1 sortable by creation time?
Yes, but special sorting functions are needed. Direct string comparison won't work because time bits aren't sequential.
Does UUID v1 expose my MAC address?
By default, yes. Most implementations use the MAC address for the node ID. Privacy-focused implementations may use random node IDs instead.