Guid - How unique is UUID

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

How safe is it to use UUID to uniquely identify something (I m using it for files uploaded to the server)? As I understand it, it is based off random numbers. However, it seems to me that given enough time, it would eventually repeat it self, just by pure chance. Is there a better system or a pattern of some type to alleviate this issue?

Answers

Very safe:

the annual risk of a given person being hit by a meteorite is estimated to be one chance in 17 billion, which means the probability is about 0.00000000006 (6 × 10−11), equivalent to the odds of creating a few tens of trillions of UUIDs in a year and having one duplicate. In other words, only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%.

Caveat:

However, these probabilities only hold when the UUIDs are generated using sufficient entropy. Otherwise, the probability of duplicates could be significantly higher, since the statistical dispersion might be lower. Where unique identifiers are required for distributed applications, so that UUIDs do not clash even when data from many devices is merged, the randomness of the seeds and generators used on every device must be reliable for the life of the application. Where this is not feasible, RFC4122 recommends using a namespace variant instead.

http://en.wikipedia.org/wiki/UUID#Random_UUID_probability_of_duplicates http://en.wikipedia.org/wiki/UUID#Random_UUID_probability_of_duplicates

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1155008/how-unique-is-uuid

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils