Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 70 lines (59 sloc) 1.893 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (** {6 From Ocaml Standard Library} *)
19
20 val init : int -> unit
21 val full_init : int array -> unit
22 val self_init : unit -> unit
23 val bits : unit -> int
24 val int : int -> int
25 val int32 : Int32.t -> Int32.t
26 val nativeint : Nativeint.t -> Nativeint.t
27 val int64 : Int64.t -> Int64.t
28 val float : float -> float
29 val bool : unit -> bool
30 module State :
31 sig
32 type t = Random.State.t
33 val make : int array -> t
34 val make_self_init : unit -> t
35 val copy : t -> t
36 val bits : t -> int
37 val int : t -> int -> int
38 val int32 : t -> Int32.t -> Int32.t
39 val nativeint : t -> Nativeint.t -> Nativeint.t
40 val int64 : t -> Int64.t -> Int64.t
41 val float : t -> float -> float
42 val bool : t -> bool
43 end
44 val get_state : unit -> State.t
45 val set_state : State.t -> unit
46
47 (** {6 Extra Function} *)
48
49 (**
50 Ensure to call [Random.self_init] once.
51 The function [Random.self_init] is called only in the first call
52 to [ensure_init] (internal reference)
53 *)
54 val ensure_init : unit -> unit
55
56 val max_int : unit -> int
57 val max_int64 : unit -> Int64.t
58
59 (**
60 [string len]
61 Generates a random string of length [len]
62 *)
63 val string : int -> string
64
65 (**
66 [alpha_string len]
67 Generates a random string of letters of length [len]
68 *)
69 val alpha_string : int -> string
Something went wrong with that request. Please try again.