Markdown

GUID

GUID is the Acronym for Globally Unique Identifier

A 128-bit number used to identify information in computer systems. It is designed to be statistically unique, meaning that while it is generated without a central registration authority, the probability of the same GUID being generated twice is virtually zero.

Format and Structure

A GUID is typically represented as a string of 32 hexadecimal digits, displayed in five groups separated by hyphens (8-4-4-4-12 format), for a total of 36 characters.

  • Example: 6B29FC40-CA47-1067-B31D-00DD010662DA
  • Total Bits: 128 bits.
  • Total Combinations: 2 to the power of 128 is approximately, which is approximately 340 undecillion. To visualize how massive this is: if you generated one billion GUIDs every second, it would take about 10 sextillion years to exhaust the entire supply. For all practical purposes, it is an infinite resource.hich is enough to assign a unique identifier to every grain of sand on earth many times over.

GUID vs. UUID

The terms are often used interchangeably, but there is a technical distinction:

  • UUID (Universally Unique Identifier): The broad standard defined by the IETF (RFC 4122) and ISO/IEC.
  • GUID: Microsoft’s specific implementation of the UUID standard. In modern computing, they are functionally identical.

Key Terminology

  • GPT (GUID Partition Table): The modern disk partitioning standard that uses GUIDs to identify every partition on a drive, replacing the old MBR (Master Boot Record) system.
  • CLSID (Class ID): A GUID used in Windows to identify software components (COM objects) within the Registry.
  • Variant/Version Bits: Specific bits within the GUID string that indicate how the identifier was generated (e.g., based on time, MAC address, or random numbers).
  • Collision: The theoretical event where two different entities are assigned the same GUID. Due to the bit length, this is considered statistically impossible in practical applications.

Common Use Cases

  • Database Primary Keys: Using a GUID as a primary key allows records to be created across different servers and merged later without ID conflicts.
  • Storage Devices: UEFI systems use GUIDs to identify hard drives, solid-state drives, and individual partitions (the ESP is identified by a specific GUID).
  • Software Development: Uniquely identifying interfaces, classes, and library versions to prevent DLL Hell (version conflicts).
  • Windows Registry: Identifying hardware drivers, file associations, and system services.

Generation Versions

VersionBasis of Generation
Version 1Combines the computer’s MAC address and the current timestamp.
Version 4Generated using high-quality pseudo-random numbers (most common today).
Version 5Generated by hashing a “name” (like a URL) using SHA-1, ensuring the same input always produces the same GUID.

Technical Note: Because Version 1 GUIDs include a hardware MAC address and a timestamp, they can theoretically be used to trace a GUID back to the specific computer and time it was created, raising potential privacy concerns. Version 4 (random) is preferred for most applications today.