Comment by Lammy

1 year ago

UUID is a 128-bit value, of which 122 bits are available for actual data. UUID was conceived as a way to mark an intersection point between two dimensions, originally for Apollo Computer's RPC system where the two dimensions were time and hardware identifier (originally originally Apollo hardware serial number, later commonly 802.3 address). The additional bits are metadata telling you that a particular 128-bit value is a UUID, not just a coincidental jumble of bits, and which type of UUID.

This site is specifically about “V4” UUIDs where the two dimensions are random and also-random. If you scroll all the way to the bottom you will see that the last table row is numbered the same value as the maximum 122-bit number, so the site is flipping every possible bit-combination within that space combined with the metadata bits that say “Hello I am a V4 UUID”:

  irb> ::Array::new(122, 0b1).reduce { (_1 << 1) | _2 } => 5316911983139663491615228241121378303