What is Universally Unique Identifier

Osirus Djodji
2 min readNov 30, 2021

--

Universally unique identifier (UUID), is a system allowing one or more distributed systems to uniquely identify information without significant central coordination. In this context, the word “unique” should be taken to mean “very likely uniqueness” rather than “guaranteed uniqueness”. These unique identifiers are encoded in 128 bits and are produced using pseudo-random components as well as the characteristics of a computer.

In its canonical textual representation, the 16 bytes of a UUID are represented as 32 lowercase hexadecimal numbers separated by 4 dashes in the form:

23e88af0–8979–44c2-a8de-82f43812c444

There are 5 versions of UUID.

Versions 3 and 5 are generated by hashing a name or namespace identifier and using the resulting hash, MD5 or SHA-1 respectively, as the source of uniqueness instead of the time sources as in versions 1 and 2 They are intended to generate UUIDs of names that are derived from, and unique in, a certain namespace. The concept of name and namespace should be interpreted broadly and not be limited to textual names. Version 4 uses random or pseudo-random sources rather than time or namespace derived sources for its uniqueness. Versions 3, 4, and 5 use their respective sources to generate 60 single output bits which are used in place of the timestamp bits used in versions 1 and 2.

PostgreSQL contains a UUID data type and can generate most versions of UUIDs through the use of module functions. MySQL provides a UUID function, which generates standard version 1 UUIDs.

--

--