package feat-core

  1. Overview
  2. Docs

Source file RandomSig.ml

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
(******************************************************************************)
(*                                                                            *)
(*                                     Feat                                   *)
(*                                                                            *)
(*                        François Pottier, Inria Paris                       *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the MIT license, as described in the file LICENSE.               *)
(******************************************************************************)

(** A subset of the signature of the module {!Stdlib.Random}. *)
module type S = sig

  module State : sig

    (** The state of the random number generator. *)
    type t

    (** [bits s] returns 30 random bits in a nonnegative integer. *)
    val bits : t -> int

    (** [int bound] returns a random integer comprised between 0 (inclusive)
        and [bound] (exclusive). [bound] must be greater than 0 and less than
        2{^30}. *)
    val int : t -> int -> int

  end

  (** [get_state()] returns the current state of the generator. *)
  val get_state : unit -> State.t

end
OCaml

Innovation. Community. Security.