RFC 4122 UUIDs¶
RFC 4122 defines five versions of UUID, while a new Internet-Draft under review defines three new versions. Each version has different generation algorithms and properties. Which one you choose depends on your use-case. You can find out more about their applications on the specific page for that version.
- Version 1: Gregorian Time
This version of UUID combines a timestamp, node value (in the form of a MAC address from the local computer’s network interface), and a clock sequence to ensure uniqueness. For more details, see Version 1: Gregorian Time.
- Version 2: DCE Security
This version of UUID is the same as Version 1, except the
clock_seq_low
field is replaced with a local domain and thetime_low
field is replaced with a local identifier. For more details, see Version 2: DCE Security.- Version 3: Name-based (MD5)
This version of UUID hashes together a namespace and a name to create a deterministic UUID. The hashing algorithm used is MD5. For more details, see Version 3: Name-based (MD5).
- Version 4: Random
This version creates a UUID using truly-random or pseudo-random numbers. For more details, see Version 4: Random.
- Version 5: Named-based (SHA-1)
This version of UUID hashes together a namespace and a name to create a deterministic UUID. The hashing algorithm used is SHA-1. For more details, see Version 5: Name-based (SHA-1).
- Version 6: Reordered Time
This version of UUID combines the features of a version 1 UUID with a monotonically increasing UUID. For more details, see Version 6: Reordered Time.
- Version 7: Unix Epoch Time
This version of UUID combines a timestamp–based on milliseconds elapsed since the Unix Epoch–and random bytes to create a monotonically increasing, sortable UUID without the privacy and entropy concerns associated with version 1 and version 6 UUIDs. For more details, see Version 7: Unix Epoch Time.