signature MLTON_RANDOM =
sig
val alphaNumChar: unit -> char
val alphaNumString: int -> string
val rand: unit -> word
val seed: unit -> word option
val srand: word -> unit
val useed: unit -> word option
end
-
alphaNumChar ()returns a random alphanumeric character.
-
alphaNumString nreturns a string of length
nof random alphanumeric characters. -
rand ()returns the next pseudo-random number.
-
seed ()returns a random word from
/dev/random. Useful as an arg tosrand. If/dev/randomcan not be read from,seed ()returnsNONE. A call toseedmay block until enough random bits are available. -
srand wsets the seed used by
randtow. -
useed ()returns a random word from
/dev/urandom. Useful as an arg tosrand. If/dev/urandomcan not be read from,useed ()returnsNONE. A call touseedwill never block — it will instead return lower quality random bits.