Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many characters are there in a GUID?

Tags:

guid

encoding

Using ASCII encoding, how many characters are there in a GUID?

I'm interested in the Microsoft style, which includes the curly brackets and dashes.

like image 725
Jim Counts Avatar asked Mar 03 '09 18:03

Jim Counts


People also ask

How long is a character GUID?

That's 36 characters in any GUID--they are of constant length. You can read a bit more about the intricacies of GUIDs here.

What is the format of a GUID?

The GUID data type is a text string representing a Class identifier (ID). COM must be able to convert the string to a valid Class ID. All GUIDs must be authored in uppercase. The valid format for a GUID is {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} where X is a hex digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).

How much of a GUID is unique?

The GUID generation algorithm relies on the fact that it has all 16 bytes to use to establish uniqueness, and if you throw away half of it, you lose the uniqueness. There are multiple GUID generation algorithms, but I'll pick one of them for concreteness, specifically the version described in this Internet draft.

What is GUID value?

The globally unique identifier (GUID) data type in SQL Server is represented by the uniqueidentifier data type, which stores a 16-byte binary value. A GUID is a binary number, and its main use is as an identifier that must be unique in a network that has many computers at many sites.


1 Answers

From MSDN:

A GUID is a 128-bit value consisting of one group of 8 hexadecimal digits, followed by three groups of 4 hexadecimal digits each, followed by one group of 12 hexadecimal digits. The following example GUID shows the groupings of hexadecimal digits in a GUID: 6B29FC40-CA47-1067-B31D-00DD010662DA

From Wikipedia:

Often braces are added to enclose the above format, as such:

{3F2504E0-4F89-11D3-9A0C-0305E82C3301} 

So a total of 38 characters in the typical hexadecimal encoding with curly braces.

-Adam

like image 115
Adam Davis Avatar answered Oct 07 '22 14:10

Adam Davis