Why are there dashes in a .NET GUID? Are there dashes in most implementations of a GUID, or is it just a Microsoft thing?
Signed,
741ecf77-9c92-4435-8e6b-85975bd13452
Why are there dashes in a .NET GUID? Are there dashes in most implementations of a GUID, or is it just a Microsoft thing?
Signed,
741ecf77-9c92-4435-8e6b-85975bd13452
This is an example of chunking, just like phone numbers, credit card numbers, etc.
Just about every visual represenation of a guid that I've seen uses the dashed format. It's much easier on the eyes.
Technically, there are no "dashes" in a GUID. A GUID is a 128-bit value which is usually stored in the following manner (using C# here to represent the structure):
public struct Guid
{
public ulong Data1;
public ushort Data2;
public ushort Data3;
public fixed byte Data4[8];
}
The dashes are in the string representation of a GUID, usually placed at the points that would delimit the structure according to the above representation in memory.
The dashes are optional and are not required in a string representation of a GUID.
The Guid class of .Net recognizes a bunch of different formats: dashes as separators, no separators, brackets as delimiters, parenthesis as delimiters, no delimiters, etc