package randii

  1. Overview
  2. Docs

randii

OCaml port of Random123 - a counter based random number generator.

This library is a pure OCaml port of the Random123 Threefry algorithms as described in Parallel Random Numbers: As Easy as 1, 2, 3, Salmon, Moraes, Dror & Shaw, SC11, Seattle, Washington, USA, 2011, ACM and originally implemented here.

In terms of number representations this library depends only on ocaml-integers with an additional dependency on zarith if one wants to run the test suite.

Testing

There is a simple CLI tool for basic testing, please see

$ randii --help

for more information.

The test suite uses Known Answer Tests from the test suite of the original implementation - specifically the Threefry data in kat_vectors and old_kat_vectors.

There is also an executable for running the Threefry implementations through the SmallCrush battery of tests via OCaml testu01:

$ dune exec -- u01/smallcrush.exe

WARNING it takes a while to run.

TODOs

  • basic arithmetic for ctr_t type,
  • make dependence on testu01 a with-test dep
OCaml

Innovation. Community. Security.