Text Encoding
A GUID is most commonly written in text as a sequence of hexadecimal digits separated into five groups, such as:
- 3F2504E0-4F89-11D3-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 |
For the first three fields, the most significant digit is on the left. The last two fields are treated as eight separate bytes, each having their most significant digit on the left, and they follow each other from left to right. Note that the digit order of the fourth field may be unexpected, since it's treated differently than in the structure.
Often braces are added to enclose the above format, such as:
- {3F2504E0-4F89-11D3-9A0C-0305E82C3301}
When printing fewer characters is desired, GUIDs are sometimes encoded into a base64 or Ascii85 string.
A base64-encoded GUID consists of 22 to 24 characters (depending on padding), for instance:
- 4AQlP4lP0xGaDAMF6CwzAQ
- 4AQlP4lP0xGaDAMF6CwzAQ==
and Ascii85 encoding gives 20 characters, for example:
- 5:$Hj:Pf\4RLB9%kU\Lj
In Uniform Resource Names (URN), GUIDs have namespace identifier "uuid", e.g.:
- urn:uuid:3F2504E0-4F89-11D3-9A0C-0305E82C3301
Read more about this topic: Globally Unique Identifier
Famous quotes containing the word text:
“If ever I should condescend to prose,
Ill write poetical commandments, which
Shall supersede beyond all doubt all those
That went before; in these I shall enrich
My text with many things that no one knows,
And carry precept to the highest pitch:
Ill call the work Longinus oer a Bottle,
Or, Every Poet his own Aristotle.”
—George Gordon Noel Byron (17881824)