Duplicate Guid

  • Thread starter Thread starter Jay Douglas
  • Start date Start date
Jay,

You probably have better odds at winning the lottery. Seriously.

What is your concern?
 
Probably not possible. Two computers would have to be built as exactly the
same time, have the same MAC address (normally impossible), and generate a
GUID at exactly the same time. (Actually, I vaguely remember that MS doesn't
use the MAC address anymore, but I may be mistaken.)
 
Just wondering ... just candy for the mind.

I've heard someone say the odds are about the same as winning the Texas
lottery 32 times.

I was just hoping a formula or a number.

I slept though statistics, so I can't come up with a good answer.

--
Jay Douglas
http://jaydouglas.com


Nicholas Paldino said:
Jay,

You probably have better odds at winning the lottery. Seriously.

What is your concern?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jay Douglas said:
Does anybody know the odds of generating a duplicate guid?
 
Jay,

I remember reading something that said you had to generate 1000 new
GUIDs per second for the next 5000 years in order to come across a duplicate
(or something like that).

I wouldn't worry =)


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jay Douglas said:
Just wondering ... just candy for the mind.

I've heard someone say the odds are about the same as winning the Texas
lottery 32 times.

I was just hoping a formula or a number.

I slept though statistics, so I can't come up with a good answer.

--
Jay Douglas
http://jaydouglas.com


Nicholas Paldino said:
Jay,

You probably have better odds at winning the lottery. Seriously.

What is your concern?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jay Douglas said:
Does anybody know the odds of generating a duplicate guid?
 
Okay math wizards, a Guid is 32 hexidecimal digits.

Each digit can be A-F or 0-9 which amounts to 16.

so, 32 possiblities of 16 characters .. what's the formula
 
Let's make this simpler. It's a 128 bit number, which means that there
are 2^128 possibilities. That turns out to be:

3.4028236692093846346337460743177e+38

That's a large number.
 
Nicholas said:
Jay,

I remember reading something that said you had to generate 1000 new
GUIDs per second for the next 5000 years in order to come across a duplicate
(or something like that).

I wouldn't worry =)
Which would be the same as 1 million new GUIDs per second for the next 5 years,
or 1 billion per second for the next couple of days, would it not? If it's that
easy, I would worry.

-rick-
 
Jay Douglas said:
Does anybody know the odds of generating a duplicate guid?
Better than the odds of an incrementing numeric counter generating a
duplicate number.

SP
 
I thought its a combination of MAC address and current clock
tick(Year-Month-Day-HH:MM:SS:millisecond). So, probablility of getting a
duplicate is virtually 0.
 
but you can never be sure. since the guid is generated using a hashfunction
of the values you mentioned, errors in the implemention of the hashfunction
can lead to duplicated guids.
 
I thought that MS stopped using the MAC address to create the guids since
the cheaper NIC cards were producing duplicate MAC addresses at an alarming
rate.
 
Nicholas,

Well put!

Taught me a little about coming up with the possibilities using the bit^2
deal too.

Thanks again.

--
Jay Douglas
http://jaydouglas.com


Nicholas Paldino said:
Let's make this simpler. It's a 128 bit number, which means that there
are 2^128 possibilities. That turns out to be:

3.4028236692093846346337460743177e+38

That's a large number.
 
Jay Douglas said:
I thought that MS stopped using the MAC address to create the guids since
the cheaper NIC cards were producing duplicate MAC addresses at an alarming
rate.

That's right, microsoft doesn't use the DCE algorithm on NT based systems
(since NT4 SP4), but the reason was a bit of "privacy paranoia", people
didn't like to give away their MAC addresses through a GUID.

Willy.
 
Willy said:
That's right, microsoft doesn't use the DCE algorithm on NT based systems
(since NT4 SP4), but the reason was a bit of "privacy paranoia", people
didn't like to give away their MAC addresses through a GUID.

Willy.

Is the algorithm MS uses to create a GUID published somewhere?

-Mark
 
Mark Rance said:
Is the algorithm MS uses to create a GUID published somewhere?

-Mark

..NET uses RNGCryptoServiceProvider which is a wrapper over the cryptographic
pseudorandom number generator inside CryptoAPI which in turn calls Win32's
API CryptGenRandom().Note that COM uses the same Win32 API but now through
CoCreateGuid().
I don't know the exact algorithm used by CryptGenRandom() and I don't think
it's a trade secret so I would suggest you to ask MSFT for details by
sending a mail to Brian LaMacchia (e-mail address removed)

Willy.
 
Back
Top