Skip to content
This repository
tag: v1502
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (59 sloc) 1.893 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
(*
Copyright © 2011 MLstate

This file is part of OPA.

OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.

OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.

You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(** {6 From Ocaml Standard Library} *)

val init : int -> unit
val full_init : int array -> unit
val self_init : unit -> unit
val bits : unit -> int
val int : int -> int
val int32 : Int32.t -> Int32.t
val nativeint : Nativeint.t -> Nativeint.t
val int64 : Int64.t -> Int64.t
val float : float -> float
val bool : unit -> bool
module State :
sig
  type t = Random.State.t
  val make : int array -> t
  val make_self_init : unit -> t
  val copy : t -> t
  val bits : t -> int
  val int : t -> int -> int
  val int32 : t -> Int32.t -> Int32.t
  val nativeint : t -> Nativeint.t -> Nativeint.t
  val int64 : t -> Int64.t -> Int64.t
  val float : t -> float -> float
  val bool : t -> bool
end
val get_state : unit -> State.t
val set_state : State.t -> unit

(** {6 Extra Function} *)

(**
Ensure to call [Random.self_init] once.
The function [Random.self_init] is called only in the first call
to [ensure_init] (internal reference)
*)
val ensure_init : unit -> unit

val max_int : unit -> int
val max_int64 : unit -> Int64.t

(**
[string len]
Generates a random string of length [len]
*)
val string : int -> string

(**
[alpha_string len]
Generates a random string of letters of length [len]
*)
val alpha_string : int -> string
Something went wrong with that request. Please try again.