Skip to main content

UUID Versions

The DomainFlow\Uuid package supports all eight UUID versions defined by various specifications and proposals.

VersionTypeKey FeatureDeterministic
v1Time-basedTimestamp, clock seq, node (MAC)
v2DCE SecurityUID/GID with timestamp
v3Name-basedMD5 hash of namespace + name
v4RandomPure randomness
v5Name-basedSHA-1 hash of namespace + name
v6Reordered timeSortable timestamp (proposed)
v7Unix timestampMillisecond timestamp + randomness
v8CustomApplication-defined formatDepends

👇 Next Steps

You can dive into each version for more detail:

  • UuidV1: Timestamp-based, includes node and clock sequence
  • UuidV2: Domain-based (UID/GID)
  • UuidV3: Name-based using MD5
  • UuidV4: Random-based
  • UuidV5: Name-based using SHA-1
  • UuidV6: Sortable time-based UUID
  • UuidV7: Unix epoch milliseconds + randomness
  • UuidV8: Reserved for custom formats

Each UUID class implements the same interface, so you can swap them easily in code depending on your needs.