开发者

Is the following a GUID

开发者 https://www.devze.com 2023-02-13 08:17 出处:网络
Is the follow开发者_开发技巧ing a valid GUID? 202008210743518A guid is just a 128 bit number, so sure you could interpret it as a guid, just with a lot of 0 padding. They are more commonly expressed a

Is the follow开发者_开发技巧ing a valid GUID? 202008210743518


A guid is just a 128 bit number, so sure you could interpret it as a guid, just with a lot of 0 padding. They are more commonly expressed as a 32 character hex string though.

00000000-0000-0000-0000-B7B9B3A4A0DE

(which is your seemingly-decimal number expressed in a 32-bit hex string)


No, it's not. A GUID is 32 hex digits, typically written in groups of 8-4-4-4-12 digits.


A GUID is a Globally Unique Identifier. Typically these are identifiers that combine a number of different factors, such as the current time, plus some ranom component, so that they are very likely to be unique, but this is not guaranteed!

You can create GUIDs using your own mechanism if you like, however, most people use the Universal Unique Identifier standard, which when written in Hex looks like this:

21EC2020-3AEA-1069-A2DD-08002B30309D

If the number you give is supposed to be a GUID, it might work OK, but I would be a bit suspicious as to just how unique it is!


A GUID looks like this: {21EC2020-3AEA-1069-A2DD-08002B30309D}. See http://en.wikipedia.org/wiki/Globally_unique_identifier.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号