Returns a random v4 UUID of the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
, where each x
is replaced with a random hexadecimal digit from 0 to f, and y
is replaced with a random hexadecimal digit from 8 to b.
Instance, based on recursion, can be found here.
Okay, I THINK I'm on track to understanding the trick behind the
a*51&52
magic now (I suspect it functions similarly to this technique to determine if a number is a power of 2 - note that, due to the bodiless design of thisfor
, where all evaluation is done in the post-loop "increment" statement, this procedure uses one-based indices and never has to deal with the zero case); I'm going to make a tool to see if I can refine the method for discovery.