GUIDs

A GUID (aka UUID) is a 16 bytes (128 bits) unique identifier. When you generate a GUID, you are guaranteed to get a totally unique one every single time, no matter how many other ones have been generated or will be generated in the future. Any time you need to uniquely identify something, consider using a GUID.

(There are about 3.4 x 10 to the 38th power possible GUIDs, enjoy.)

For a GUID with a name attached, the GUID should be considered the identifier, and the name merely a descriptor of what it is identifying. In the event of identical GUIDs with differing names, the two GUIDs (and/or what they identify) should still be considered identical. Which name is used after that point is arbitrary, but an "older" name should be given precedence.

  • Human Readable {7926AE20-DF09-4e7b-90E3-779C0B4B6DEB}
  • Named "{7926AE20-DF09-4e7b-90E3-779C0B4B6DEB};Wasabi"
  • Hex Format (C struct) { 0x7926ae20, 0xdf09, 0x4e7b, { 0x90, 0xe3, 0x77, 0x9c, 0xb, 0x4b, 0x6d, 0xeb } }

Remember, GUIDs are NOT EXPENSIVE. This is the age of 3Ghz+ and 2gig+ RAM systems, and speeds will only increase with time. Never use an int when a GUID is appropriate.