Why is the 17th digit of version 4 GUIDs limited to only 4 possibilities?

前端 未结 2 643
无人共我
无人共我 2021-01-19 00:23

I understand that this doesn\'t take a significant chunk off of the entropy involved, and that even if a whole nother character of the GUID was reserved (for any purpose), w

2条回答
  •  迷失自我
    2021-01-19 00:52

    Quoting the estimable Mr. Lippert

    First off, what bits are we talking about when we say “the bits”? We already know that in a “random” GUID the first hex digit of the third section is always 4....there is additional version information stored in the GUID in the bits in the fourth section as well; you’ll note that a GUID almost always has 8, 9, a or b as the first hex digit of the fourth section. So in total we have six bits reserved for version information, leaving 122 bits that can be chosen at random.

    (from https://ericlippert.com/2012/05/07/guid-guide-part-three/)

    tl;dr - it's more version information. To get more specific than that I suspect you're going to have to track down the author of the spec.

提交回复
热议问题