什么是得到相同的GUID 1十亿反复的可能性有多大? [英] What are the chances of getting the same GUID in 1 billion iterations?

查看:1182
本文介绍了什么是得到相同的GUID 1十亿反复的可能性有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个项目,我需要生成大约十亿的GUID。

I am working on a project where I need to generate approximately 1 billion GUIDs.

我知道的GUID不保证唯一性,但是是唯一的,几乎所有的时间。

I know GUIDs are not guaranteed to be unique but are unique almost all of the time.

如果我产生了十亿的GUID,那是什么会有一个匹配的概率是多少?

If I generated a billion GUIDs, what is the probability that there will be a match?

推荐答案

<一个href="http://blogs.msdn.com/b/oldnewthing/archive/2008/06/27/8659071.aspx">http://blogs.msdn.com/b/oldnewthing/archive/2008/06/27/8659071.aspx

在.NET GUID由

The .NET GUID consists of

  • 在60位的时间戳,
  • 在48位计算机的标识符,
  • 唯一标志的14位,和
  • 在六位固定

因此​​,通过奥斯卡引述的UUID的概率并不在这里工作。但是,如果您从一台计算机所有的1十亿的GUID,就没有机会得到重复的(除非你在玩的时钟; - )

So the UUID probability quoted by Oscar does not work here. But if you create all your 1 billion GUIDs from one computer, there is no chance to get a duplicate (except you are playing with the clock ;-)

这篇关于什么是得到相同的GUID 1十亿反复的可能性有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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