UUID Versions
The DomainFlow\Uuid
package supports all eight UUID versions defined by various specifications and proposals.
Version | Type | Key Feature | Deterministic |
---|---|---|---|
v1 | Time-based | Timestamp, clock seq, node (MAC) | ❌ |
v2 | DCE Security | UID/GID with timestamp | ❌ |
v3 | Name-based | MD5 hash of namespace + name | ✅ |
v4 | Random | Pure randomness | ❌ |
v5 | Name-based | SHA-1 hash of namespace + name | ✅ |
v6 | Reordered time | Sortable timestamp (proposed) | ❌ |
v7 | Unix timestamp | Millisecond timestamp + randomness | ❌ |
v8 | Custom | Application-defined format | Depends |
👇 Next Steps
You can dive into each version for more detail:
UuidV1
: Timestamp-based, includes node and clock sequenceUuidV2
: Domain-based (UID/GID)UuidV3
: Name-based using MD5UuidV4
: Random-basedUuidV5
: Name-based using SHA-1UuidV6
: Sortable time-based UUIDUuidV7
: Unix epoch milliseconds + randomnessUuidV8
: Reserved for custom formats
Each UUID class implements the same interface, so you can swap them easily in code depending on your needs.