6 signature MLTON_RANDOM =
8 val alphaNumChar: unit -> char
9 val alphaNumString: int -> string
10 val rand: unit -> word
11 val seed: unit -> word option
12 val srand: word -> unit
13 val useed: unit -> word option
19 returns a random alphanumeric character.
23 returns a string of length `n` of random alphanumeric characters.
27 returns the next pseudo-random number.
31 returns a random word from `/dev/random`. Useful as an arg to
32 `srand`. If `/dev/random` can not be read from, `seed ()` returns
33 `NONE`. A call to `seed` may block until enough random bits are
38 sets the seed used by `rand` to `w`.
42 returns a random word from `/dev/urandom`. Useful as an arg to
43 `srand`. If `/dev/urandom` can not be read from, `useed ()` returns
44 `NONE`. A call to `useed` will never block -- it will instead return
45 lower quality random bits.