Alex Rivera | Logout

Are UUIDs unique across different systems?

Asked 2011-04-09T02:05:13.897
16

I'm wondering if UUIDs are unique even when they are generated on different systems, which may employ different algorithms. For instance, if you generated a bunch of UUIDs in MySQL, and .Net, would there be a higher chance of collision, or are all systems using the exact same algorithm, and thereby guaranteeing that collisions are improbable?

Edit
Report

1 Answer

2

No, it can vary. Basically, the chance of a collision depends on the amount of entropy (="true" unpredictability) in the UUID generation method.

(a) there are different standard formats of UUID, each of which intrinsically have varying amounts of entropy (e.g. if you base your UUID on a Mac and timestamp, this in principle has less entropy than basing your UUID simply on a string of random bits)

(b) for Type 4, based on random bits, there's no standard random number generation algorithm/standard entropy source.

If you have a "perfect" random number generator, then a random UUID has 2^116 possible values (12 bits are wasted on version markers etc), in other words you would expect to generate around 2^56 or 7x10^16 UUIDs before getting a collision.

answered 2011-04-09T02:17:12.667

Your Answer