Monday, May 8, 2017

Globally Unique Identifiers (GUIDs) How Unique are they?


GUIDs are used as identification tags to identify and track things.  The clue is in the name.  They are unique, however because each one is a id within a defined set, it is theoretically possible to get a duplicate GUID. How possible? - well as "unique" suggests, it is nearly impossible.

What is a GUID?
A GUID is a set of 32 characters each of which has a hexadecimal value (0-f).  The are arranged in the format
21EC2020-3AEA-4069-A2DD-08002B30309D
They are typically randomly generated.

Each of the 32 characters is made up of 4 bits so the number of bits in the GUID is 4x32=128

6 of the bits are reserved to designate that GUID is random.

The remaining 122 bits (128-6=122) can either be 1 or 0.  This means there are 2 to the power 122 (2^122) combinations.

How many possible GUIDs are there?

2^122 which is approximately 5.3×1036
At this point it becomes a waste of time and space to use long hand notation.  These types of numbers are generally referred to in science as large numbers.  What? You'd still like to see the actual number? Oh OK its
5,316,911,983,139,663,491,615,228,241,121,400,000

So at this point you need something to compare that with to get a feel for how big that number is.  Here's a few numbers in order of size to get an idea.

In ascending order then:
The mass of planet earth in Kilograms
6 x 1024

Number of atoms in the average human body.
7 x 1027

The mass of the Earths Sun in Kilograms
2 x 1030

The number of water molecules in an olympic size swimming pool
1.34 x 1032

Number of possible GUIDs
 5.3×1036

Number of atoms that make up the planet earth.
1 x 1050


http://physicsoftheuniverse.com/numbers.html

http://mrdee.blogspot.co.uk/2005/11/how-many-guid-combinations-are-there.html