Gregor Purdy - Universally Unique Identifiers (UUIDs)

The earliest reference we have seen for UUIDs is the book Network Computing Architecture by Lisa Zahn, et al.

Some additional information can be found in the 1998-02-04 version (revision 1) of the Internet draft document, which we have cached here. Included is C source code for the 'uuidgen' program.

Also, RFC-2518 and ISO-11578 discuss UUIDs.

Universal Unique IDentifier. Typically generated from a combination of a computer's network card MAC, a timestamp, and some random bits. Originally defined as part of the Network Computing System (NCS), and later adopted by the DCE standard, UUIDs have found broader use.

These are 128-bit numbers usually represented as 32 hex digits, grouped in a 8-4-4-4-12 pattern. A common synonym for UUID is GUID, which stands for Globally Uunique IDentifier.

In IDL files, they look like this: uuid(5a389ad2-22dd-11d1-aa77-002035b29092).

In the Windows Registry they are written like this: {5a389ad2-22dd-11d1-aa77-002035b29092}.

And sometimes all punctuation is omitted, like this: 5a389ad222dd11d1aa77002035b29092.

Since the characters represent hexadecimal digits, case is not significant. However, be careful when storing and comparing UUIDs in files or databases because case-sensitive string comparisons can create false negative compares on two strings that should be considered the same UUID. In fact, you should standardize all UUIDs explicitly to one chosen form before putting them into storage.

If you are really ambitious, you could convert all UUIDs to their decimal form and use decimal comparisons on them to avoid the string issues in databases. It would require ceil(128 * log(2) / log(10)) --> 39 digits to store any possible UUID.

If you are using a low-level programming language, you can store your UUIDs in four 32-bit words, or two 64-bit words depending upon the system's architecture. Then, you can use simple multi-word comparisons to compare them.


We have cached the 1997-02-24 version (revision 0) of this document here.

We have also done a simple conversion of the (revision 1) document to XML, which can be had here.

: 2005-12-04 21:14:52 -0800 (Sun, 04 Dec 2005) $