Universally Unique IDentifier (UUID) or Globally Unique IDentifier (GUID)
  • is a 128-bit number used to identify information in computer systems
  • their uniqueness does not depend on a central party nor on a coordination of parties
  • while the probability that a UUID will be duplicated is not zero, it is close enough to zero to be negligible

Format

the 16 octets of a UUID are represented as 32 hexadecimal (base-16) digits, displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and 4 hyphens).

For example:

Indent

123e4567-e89b-12d3-a456-426655440000
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

The 4 bit M and the 1 to 3 bit N fields code the format of the UUID itself:

  • the 4 bits of digit M are the UUID version
  • the 1 to 3 most significant bits of digit N code the UUID variant

In the example, M is 1, and N is a (10xx2), meaning that this is a version-1, variant-1 UUID; that is, a time-based DCE/RFC 4122 UUID.

UUID Record Layout

Name

Length (bytes)

Length (hex digits)

Contents

time_low

4

8

integer giving the low 32 bits of the time

time_mid

2

4

integer giving the middle 16 bits of the time

time_hi_and_version

2

4

4-bit “version” in the most significant bits, followed by the high 12 bits of the time

clock_seq_hi_and_res clock_seq_low

2

4

1 to 3-bit “variant” in the most significant bits, followed by the 13 to 15-bit clock sequence

node

6

12

the 48-bit node id