How is an UUID / GUID madeGeneralAn UUID is basically just a 128 bit number, the structure, and the way it is constructed is determined by the variant and the version. The correct way to construct these identifiers is described in RFC 4122 the contents of this document is my interpretation of that document. These pages intend to give a simpler explanation of what is written in the Leach, Mealling and Salz draft.VariantsTo accomodate for past mistakes and future improvements a variant is encoded into the UUID. The variant is stored in the most significant bits of the fourth group. Currently known variants are:
The variant can be extrected from the UUID, after doing some work: 58e0a7d7-eebc-11d8-9669-0800200c9a66 The bit representation of hexadecimal number 96 is 10010110. This number starts with 10 and therefore is an UUID constructed according to the current variant. One should currently not encouter UUIDs with E or F on the position of the (underlined, big, fat) 9 in this example, as these variants are reserved for future use. In the current variant this group starts with a 8, 9, a or b. VersionsIn the current variant 5 basic types "versions" of UUIDs are in used.
Every version is made in its own way. How is a Time-based UUID madeHow is a Name-based UUID madeHow is a Random UUID madeWhat is an UUIDI need an UUIDIf you have improvements, contact information on the homepage of this host.An agent adding logging to your java programs at runtime The uptime of home.famkruithof.net |