Is a GUID unique 100% of the time?

前端 未结 22 2828
孤独总比滥情好
孤独总比滥情好 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:32

    Is a GUID unique 100% of the time?

    Not guaranteed, since there are several ways of generating one. However, you can try to calculate the chance of creating two GUIDs that are identical and you get the idea: a GUID has 128 bits, hence, there are 2128 distinct GUIDs – much more than there are stars in the known universe. Read the wikipedia article for more details.

提交回复
热议问题