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