1 (* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
10 signature MLTON_RANDOM =
12 (* Return a random alphanumeric character. *)
13 val alphaNumChar: unit -> char
15 (* Return a string of random alphanumeric characters of specified
18 val alphaNumString: int -> string
20 (* Get the next pseudrandom. *)
21 val rand: unit -> word
23 (* Use /dev/random to get a word. Useful as an arg to srand.
24 * Return NONE if /dev/random can't be read.
26 val seed: unit -> word option
28 (* Set the seed used by rand. *)
29 val srand: word -> unit
31 (* Use /dev/urandom to get a word. Useful as an arg to srand.
32 * Return NONE if /dev/urandom can't be read.
34 val useed: unit -> word option