Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the format of GUID always the same?

Tags:

string

c#

guid

GUID you get something like aaaef973-d8ce-4c92-95b4-3635bb2d42d5

Is it always the same? Is it always going to have the following format

8 char "-", 4 char "-", 4 char "-", 4 char "-", 12 char

I'm asking because i need to convert a GUID without "-" to GUID with "-" and vice visa.

like image 418
001 Avatar asked Oct 15 '11 02:10

001


People also ask

What format is 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).

Are GUIDs always the same length?

So the answer is "yes", it will always be the same length. As for the 4, it is a version number (according to http://en.wikipedia.org/wiki/Uuid). Every GUID that you generate with that algorithm will have a 4 in that position, but older GUIDs will have a 1, 2, or 3.

Is machine GUID unique?

The MACHINEGUID is the unique identifier for each client machine. Therefore if there are duplicate MACHINEGUID entries, machine entries in the Encryption Management Server database will be constantly overwritten.

Is C# GUID unique?

C# Guid. A GUID (Global Unique IDentifier) is a 128-bit integer used as a unique identifier.


1 Answers

No; there are other formats, such as the format you listed except with braces. There's also more complex formats. Here are some of the formats MSDN lists:

UUID formats

  • 32 digits: 00000000000000000000000000000000 (N)
  • 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 (D)
  • 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} (B)
  • 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) (P)
  • Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces: {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} (X)

—MSDN

like image 199
icktoofay Avatar answered Sep 22 '22 20:09

icktoofay