怎么样才能使一个Guid.NewGuid()复制的可能性有多大? [英] What are the chances to get a Guid.NewGuid () duplicate?

查看:187
本文介绍了怎么样才能使一个Guid.NewGuid()复制的可能性有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:结果
是时间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 unique

In 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆