[MLton] Wrong behaviour of MLton.Random.alphaNumString?

Stephen Weeks MLton@mlton.org
Sun, 28 Dec 2003 15:17:41 -0800


> However, I am (more than) a little suspicious of the hard-coded 6.  In
> particular, 62^6 = 56,800,235,584; not 965,660,736.  I'm not sure where
> that number came from.

Yuck.  I have no idea where the miscomputation came from.

> Regardless, we should really compute the refresh period, rather than
> hard-code it.  I believe we should have:
> 
> val m = Int.quot(Word.wordSize, IntInf.log2 (IntInf.fromInt n) + 1)

Looks good.  Thanks for the close reading and the fix.  Hopefully the
latest checkin is clearer (and correct).