为什么 .NET GUID 中有破折号? GUID 的大多数实现中是否有破折号,或者它只是 Microsoft 的东西?
签,
741ecf77-9c92-4435-8e6b-85975bd13452
最佳答案
从技术上讲,GUID 中没有“破折号” . GUID 是一个 128 位的值,通常以以下方式存储(此处使用 C# 表示结构):
public struct Guid
{
public ulong Data1;
public ushort Data2;
public ushort Data3;
public fixed byte Data4[8];
}
破折号是 GUID 的字符串表示形式。
破折号是可选的,在 GUID 的字符串表示中不是必需的。
也就是说,there are historical reasons as to where the placement of the dashes are ,与 GUID 的生成方式有关,但该历史语义不再适用。
关于.net - 为什么 .NET GUID 中有破折号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3557382/