package pure-splitmix

  1. Overview
  2. Docs
Purely functional splittable PRNG

Install

Dune Dependency

Authors

Maintainers

Sources

0.3.tar.gz
sha256=8e01f8a07bf5905c81ed9fb8f9a3547a5660356f4697bb849fc77dfd5829f823

doc/pure-splitmix/PureSplitMix/index.html

Module PureSplitMixSource

A purely functional splittable PRNG.

Sourcetype t

PRNG state, immutable.

Initialization

Sourceval of_seed : int64 -> t

Initialize from an integer.

Sourceval of_string : string -> t

Initialize by hashing a string.

Sourceval auto_seed : unit -> t

Initialize impurely in a system-dependent way.

Generate values

A state should be used only once to ensure the outputs are independent.

Sourceval split : t -> t * t

Split the state.

Sourceval vary : int -> t -> t

Infinitary split. Index must be >= 0.

Sourceval next_int64 : t -> int64 * t

Generate 64 random bits, and return a new state.

Sourceval int64 : t -> int64

Generate 64 random bits.

Sourceval int_signed : t -> int

Generate an int uniformly in the range [min_int, max_int]

Sourceval int_nonneg : t -> int

Generate an int uniformly in the range [0, max_int]

Sourceval int : t -> int -> int

Generate an int uniformly in a range [0, bound).

Sourceval bool : t -> bool

Generate a bool.

Internal functions

Sourcemodule Internal : sig ... end

Exported for testing.

OCaml

Innovation. Community. Security.