Is a GUID unique 100% of the time?

前端 未结 22 2557
孤独总比滥情好
孤独总比滥情好 2020-11-22 01:31

Is a GUID unique 100% of the time?

Will it stay unique over multiple threads?

22条回答
  •  既然无缘
    2020-11-22 02:29

    Eric Lippert has written a very interesting series of articles about GUIDs.

    There are on the order 230 personal computers in the world (and of course lots of hand-held devices or non-PC computing devices that have more or less the same levels of computing power, but lets ignore those). Let's assume that we put all those PCs in the world to the task of generating GUIDs; if each one can generate, say, 220 GUIDs per second then after only about 272 seconds -- one hundred and fifty trillion years -- you'll have a very high chance of generating a collision with your specific GUID. And the odds of collision get pretty good after only thirty trillion years.

    • GUID Guide, part one
    • GUID Guide, part two
    • GUID Guide, part three

提交回复
热议问题