UUID Versions and How They Are Built
AnyTool UUID Generator implements the versions defined in RFC 9562 (the May 2024 revision of RFC 4122), all in the browser. Version 4 fills 122 bits with cryptographically-secure random data — produced by crypto.randomUUID when available, otherwise crypto.getRandomValues — and sets the version and variant bits exactly as the spec requires. Version 7 places a 48-bit Unix millisecond timestamp at the front followed by random bits, so the identifiers sort by creation time and index well as database keys. Version 1 is timestamp-based but uses a random node and clock sequence rather than a real network MAC address. Version 5 derives a deterministic UUID from a namespace UUID plus a name using a SHA-1 hash via crypto.subtle, and the nil and max UUIDs provide the all-zero and all-one sentinel values.
- RFC 9562 versions supported: v4, v7, v1, v5, plus nil and max
- v4 uses crypto.randomUUID / getRandomValues — 122 random bits
- v7 prepends a 48-bit Unix-ms timestamp so IDs sort chronologically
- v1 uses a random node, never the machine’s real MAC address
- v5 is a SHA-1 hash of namespace + name (deterministic) via crypto.subtle
