1

RFC4122 what does phrase uniqueness across space and time mean and please explain.

Community
  • 1
  • 1
Madhukar Moogala
  • 635
  • 1
  • 5
  • 11

2 Answers2

1

"across space and time" describes how unlikely it is for two UUIDs to be the same.

128 bits of entropy is quite large and a collision would be like flipping a coin 128 heads in a row twice or rolling a 6 on a 6 sided die 50 times twice. To determine the bits of entropy here, you take the log_2 of the number of options:

  • 128 UUID bits / log_2(2) => 128 / 1 => 128 coin flips
  • 128 UUID bits / log_2(6) => 128 / 2.6 ~=> 50 dice rolls

This duplication is called a UUID collision, and it is possible; however, the chance is extremely small and not worth worrying about.

FoggyDay
  • 11,962
  • 4
  • 34
  • 48
Ross Jacobs
  • 2,962
  • 1
  • 17
  • 27
1

It basically means that for all realistic purposes, that ID is statistically guaranteed to be unique

While it is not technically impossible for the UUID to be duplicated again, the formula for calculating the probability of that looks like this. n is equal to the number of digits in the UUID and r is the number of UUIDs you want. Try plugging this into a calculator.

enter image description here

Well, the calculator broke if you tried that as the computation is massive. And the value of that for just 32 character UUIDS would be very close to 1 for any number less than 10^16 number of numbers. That is 10 quadrillion.

You are not going to run out of UUIDs if you are Facebook. You are not going to run out of IDs if you are the US government. Both store a massive amount of data (space) and have been generating data for a long time (time).

Matthew Gaiser
  • 4,558
  • 1
  • 18
  • 35