Backport from sid to buster
[hcoop/debian/mlton.git] / lib / stubs / mlton-stubs / random.sig
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.
5 *
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
8 *)
9
10 signature MLTON_RANDOM =
11 sig
12 (* Return a random alphanumeric character. *)
13 val alphaNumChar: unit -> char
14
15 (* Return a string of random alphanumeric characters of specified
16 * length.
17 *)
18 val alphaNumString: int -> string
19
20 (* Get the next pseudrandom. *)
21 val rand: unit -> word
22
23 (* Use /dev/random to get a word. Useful as an arg to srand.
24 * Return NONE if /dev/random can't be read.
25 *)
26 val seed: unit -> word option
27
28 (* Set the seed used by rand. *)
29 val srand: word -> unit
30
31 (* Use /dev/urandom to get a word. Useful as an arg to srand.
32 * Return NONE if /dev/urandom can't be read.
33 *)
34 val useed: unit -> word option
35 end