chickadee » sodium » random-uniform

random-uniform upper-boundprocedure

Returns an unpredictable value between 0 and upper-bound (excluded). Unlike (modulo random-byte upper-bound), it does its best to guarantee a uniform distribution of the possible output values even when upper-bound is not a power of 2.