怎么样才能使一个Guid.NewGuid()复制的可能性有多大? [英] What are the chances to get a Guid.NewGuid () duplicate?
问题描述
可能重复:结果
的是时间GUID独特的100%?结果
的简单证明GUID是不唯一
块引用>
在MSDN你可以阅读:
的新的Guid的值将是全零或等于任何其它的Guid的机会非常低 页。 >
你说,你有这将创建一个文件每秒的方法,并使用方法
Guid.NewGuid()
为文件名,是有可能得到相同GUID呢?或将本地计算机跟踪以某种方式?多么低的几率?
解决方案您永远不会用完的GUID。复制它们的可能性是很低的:
的 http://betterexplained.com/articles/the-quick-guide-to-guids/
Possible Duplicate:
Is a GUID unique 100% of the time?
Simple proof that GUID is not uniqueIn MSDN you can read:
The chance that the value of the new Guid will be all zeros or equal to any other Guid is very low.
Say that you have an method that will create a file every second, and you use the method
Guid.NewGuid()
for filename, is it possible to get the same Guid then? Or will the local computer keep track in some way? How low is the chance ?解决方案You would never run out of guids. The likelihood of duplicating them is VERY low:
http://betterexplained.com/articles/the-quick-guide-to-guids/
这篇关于怎么样才能使一个Guid.NewGuid()复制的可能性有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!