Library
Module
Module type
Parameter
Class
Class type
This library includes OCaml implementation of some pseudorandom number generators (PRNGs) designed by David Blackman and Sebastiano Vigna behind an interface that mimmics that of the Random
module of the standard library.
The Xoshiro generators (for XOR/shift/rotate) are all-purpose generators (not cryptographically secure). Compared to the standard library, they:
xoshiro256++
/xoshiro256**
generators have a period of 2²⁵⁶-1.xoshiro256++
/xoshiro256**
pass the whole BigCrush test suite while the Random
module of the standard library systematically fails some of the tests.This module and all the variants (see below) are drop-in replacements of the Random
module of the standard library. This means you can use Xoshiro
everywhere where you would use Random
. For instance:
Xoshiro.bits
instead of Random.bits
int
, bool
, etc. and also for the State
submodule)open Xoshiro
instead of open Random
module Random = Xoshiro
at the beginning of every file.David Blackman and Sebastiano Vigna present several variants of their generators depending on the state size and implementation details.
module Xoshiro256plusplus : sig ... end
The module Xoshiro
includes by default an implementation of Xoshiro256plusplus
.
include module type of Xoshiro256plusplus
Direct bindings of the functions provided in the original implementation.
module LowLevel : sig ... end