Search code examples
theoryguid

What's the Rationale Behind the Design of GUID's?


I don't understand GUID's. I mean, I understand that they're a big random number with trivially small likelihood of duplication, but why do they have such a strictly defined format? (I am referencing most of my information from http://en.wikipedia.org/wiki/Globally_unique_identifier.)

Why not just make GUID's a completely random 128bit integer and call it a day? It seems that all the restrictions and rules put upon generating them would reduce the entropy in some ways. Why have some of the bits reserved for format and variant specification? Why specify endianness?

The variant and format specifications are what really puzzle me. If its just a random identifier, why would a consumer of the GUID care about what format it was in? It's a 128bit random identifier. Isn't that enough?


Solution

  • Don't confuse randomness and uniqueness.

    Without the strict formatting on where, for instance, the MAC address is incorporated, then two machines could potentially generate the same random identifier at the same time. At this point, it's no longer "globally unique".