package bam

  1. Overview
  2. Docs

This module is similar to the Random module exposed by the standard library except it contains also a split function. This function exists in the Random module of the standard library since OCaml 5.0. We use this one for compatibility with previous OCaml versions.

type t

Creating and seeding PRNGs

val seed : string -> t
val make : int array -> t
val make_self_init : unit -> t

Generating pseudo-random data

val bool : t -> bool * t
val bit : t -> bool * t
val uniform : t -> float * t
val float : float -> t -> float * t
val byte : t -> int * t
val bits8 : t -> int * t
val int : int -> t -> int * t
val bits : t -> int * t
val bits30 : t -> int * t
val bits32 : t -> int32 * t
val int32 : int32 -> t -> int32 * t
val bits64 : t -> int64 * t
val int64 : int64 -> t -> int64 * t
val nativebits : t -> nativeint * t
val nativeint : nativeint -> t -> nativeint * t
val char : t -> char * t

Splitting

val split : t -> t * t
OCaml

Innovation. Community. Security.