The humble GUID/UUID…

Guids come up periodically. They’re the one obvious choice when a truly unique identifier is needed but you can’t have some application specific central registry (akin to Dicom-3 identifiers).

They look like somewhat random strings of hex digits with dash separators but there is additional structure in there.

The originated with OSF-DCE (the one unix distributed computing environment). Microsoft borrowed parts of OSF-DCE when building COM and DCOM. Guids came along for the ride in this and became part of the windows infrastructure.

In a recent discussion, a piece of code that loaded up ‘fake’ Guids as small integers with zero fill came up. I refreshed my memory (they’re now defined in RFC4122) and came to the conclusion that these aren’t well formed UUIDs at all. There are a couple of short bit fields within the body of a GUID that define the version and type of the GUID. These can’t be zero unless all bits are zero (the null GUID).

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.