News for hackers. Stuff that matters.
Re:TIL: Versions of UUID and when to use them by wongarsu on Sunday August 25, 2024 @06:41PM (#41352162)
UUID 4 also sets 4 bits to fixed values to indicate it's version 4. You can argue whether creating different namespaces between the different methods of creating UUIDs is useful. But your plain random number generator has only a 1/16 chance of generating a valid UUIDv4. (setting the bits correctly is however trivial if you do want to roll your own uuid generator)
Re:TIL: Versions of UUID and when to use them by badindentation on Sunday August 25, 2024 @07:53PM (#41352610)
From reading wikipedia it seems it's less than that since the 4th group also uses bit to set the variant.

e.g.

XXXXXXXX-XXXX-4XXX-[89AB]XXX-XXXXXXXX

From looking at all the ones in my system.

Re:TIL: Versions of UUID and when to use them by edflsafoiewq on Monday August 26, 2024 @03:08AM (#41354708)
Each method is designed so two IDs both generated with that method don't collide with each other. Reserving bits for the method avoids the problem of having to also ensure that for all pair-wise combinations of methods, two IDs generated with those methods don't collide. This is also why there is only a finite set of universally agreed upon methods.