How does C# generate GUIDs?

后端 未结 8 1270
北荒
北荒 2020-12-17 07:38

How are GUIDs generated in C#?

8条回答
  •  清歌不尽
    2020-12-17 08:24

    Original question:

    How the Guid is generating it's identifier?? How will be it's output if I use the following code Guid g = Guid.NewGuid();

    Whether the output will be the combination of numbers and lettters or the numbers alone will be there???

    A .Net System.Guid is just a 128-bit integer (16 bytes). Numbers and letters have nothing to do with it. You can use the ToString() method to see various "human-readable" versions of a Guid, which include numbers 0-9 and letters A-F (representing hex values), but that's all up to you how you want to output it.

提交回复
热议问题