A UUID is a 128-bit number. The meaning of the bits is determined by the
variant, of which four are defined. The two most common variants further define eight
versions.
Variants The
variant field is in a variable number of the most-significant bits of the ninth byte. It indicates the format of the UUID. The following variants are defined: • The Apollo NCS variant 0 (indicated by the one-bit pattern 0xxx2) is for backwards compatibility with the now-obsolete Apollo
Network Computing System 1.5 UUID format developed around 1988. The variant field of current UUIDs overlaps the address family octet in NCS UUIDs in such a way that any NCS UUIDs still in use have a 0 in the first bit of the variant field. • The OSF DCE variant 1 (102) UUIDs are referred to as RFC 4122/DCE 1.1 UUIDs, or "Leach–Salz" UUIDs, after the authors of the original
Internet Draft. • The Microsoft COM/DCOM variant 2 (1102) is characterized in the RFC as "reserved, Microsoft Corporation backward compatibility" and was used for early GUIDs on the
Microsoft Windows platform. The main difference between this variant and variant 1, aside from the extra variant bit, is byte-ordering within the UUID. Current Microsoft tools do not generate this variant. Also, RFC 9562, which added versions 6, 7, and 8, states that the variants other than variant 1 are out of its scope though this is unlikely to result in interoperability problems in practice. The versions applicable to the legacy Microsoft variant 2 are therefore somewhat unclear, but likely include only versions 1, 3, and 4. • Variant 3 (1112) is reserved.
Versions The OSF DCE and Microsoft COM/DCOM variants (1 & 2) have
versions, indicated by the value of the high 4 bits of the 7th byte of the UUID. In textual representations of the UUID, this is the character after the second hyphen.
Versions 1 and 6 (date-time and MAC address) Version 1 concatenates the 48-bit
MAC address of the "node" (that is, the computer generating the UUID), with a 60-bit timestamp. On systems with 64-bit EUI-64 "MAC addresses", the least significant 48 bits are used. A 48-bit random number may also be used. The timestamp is the number of 100-
nanosecond intervals since midnight 15 October 1582
Coordinated Universal Time (UTC), the date on which the
Gregorian calendar was first adopted. RFC 4122 states that the time value rolls over around 3400 AD,
Versions 3 and 5 (namespace name-based) Version 3 and version 5 UUIDs are generated by
hashing a
namespace identifier and name. Version 3 uses
MD5 as the hashing algorithm, and version 5 uses
SHA-1. The uniqueness of the UUIDs based on network-card MAC addresses also depends on network-card manufacturers properly assigning unique MAC addresses to their cards, which like other manufacturing processes is subject to error. Also, MAC addresses may not come from network cards. For example, virtual machines receive a MAC address from a range that is configurable in the hypervisor, and some operating systems permit the end user to customise the MAC address, notably
OpenWrt. When a device has an EUI-64 64-bit "MAC address", using the least significant 48 bits of it, as recommended by the RFC, may result in the node ID part of the UUID being duplicated. Thus, node IDs based on MAC addresses may not be globally unique. Usage of the node's network card MAC address for the node ID does often mean that version 1, 2, and 6 UUIDs can be tracked back to the computer that created them. Documents can sometimes be traced to the computers where they were created or edited through UUIDs embedded into them by
word processing software. This
privacy hole was used when locating the creator of the
Melissa virus. RFC 9562 does allow the MAC address in a version 1, 2 or 6 UUID to be replaced by a random 48-bit node ID, either because the node does not have a MAC address, or because it is not desirable to include it. In that case, the RFC requires that the least significant bit of the first octet of the node ID should be set to 1. This corresponds to the
multicast bit in MAC addresses, and setting it serves to differentiate UUIDs where the node ID is randomly generated from UUIDs based on MAC addresses from network cards, which typically have
unicast MAC addresses. == Special values ==