The intent of Universally Unique Identifiers is to enable distributed systems to uniquely identify information or Entities without significant central coordination. In this context the word unique should be taken to mean "practically unique" rather than "guaranteed unique". Since the identifiers have a finite size, it is possible for two differing items to share the same identifier.
The identifier size and generation process need to be selected so as to make this sufficiently improbable in practice. Anyone can create a UUID and use it to identify something with reasonable confidence that the same identifier will never be unintentionally created by anyone to identify something else. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve identifier (ID) conflicts.
Microsoft defines a format which is split into four fields, defined as follows:
Bits | Bytes | Name | Microsoft Endianness | Endianness RFC 4122 |
---|---|---|---|---|
32 | 4 | Data1 | Native | Big |
16 | 2 | Data2 | Native | Big |
16 | 2 | Data3 | Native | Big |
64 | 8 | Data4 | Big | Big |
This endianness applies only to the way in which a GUID is stored, and not to the way in which it is represented in text. GUIDs and RFC 4122 UUIDs should be identical when displayed textually.
One to three of the most significant bits of the first byte in Data 4 define the type variant of the GUID:[3]
Pattern | Description |
---|---|
0xx | Network Computing System backward compatibility |
10x | Standard |
110 | Microsoft Component Object Model backward compatibility; this includes the GUIDs for important interfaces like IUnknown and IDispatch |
111 | Reserved for future use |
3F2504E0-4F89-41D3-9A0C-0305E82C3301
This text notation contains the following fields, separated by hyphens:
Hex digits | Description |
---|---|
8 | Data1 |
4 | Data2 |
4 | Data3 |
4 | Initial two bytes from Data4 |
12 | Remaining six bytes from Data4 |
{3F2504E0-4F89-41D3-9A0C-0305E82C3301}This is sometimes known as "registry format".