package mirage-types

  1. Overview
  2. Docs
On This Page
  1. Random

Random

Operations to generate randomness. This is currently a passthrough to the OCaml Random generator, and will be deprecated and turned into a proper DEVICE with blocking modes.

val self_init : unit -> unit

Initialize the generator with a random seed chosen in a system-dependent way.

val int : int -> int

int bound returns a random integer between 0 (inclusive) and bound (exclusive). bound must be greater than 0 and less than 230.

val int32 : int32 -> int32

int32 bound returns a random integer between 0 (inclusive) and bound (exclusive). bound must be greater than 0.

OCaml

Innovation. Community. Security.