package randii

  1. Overview
  2. Docs
A pure OCaml port of the Random123 counter based random number generator from DEShaw Research

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=1f8f3a98495497cece0131f11c0297e7
sha512=4377b604e5debe94ba98e980ffdbb92e936306460b7db65eee2d1d5493f0abc12f54982527d49351b8461e3208ac158aed79a932575872956e849a432d058e85

doc/src/randii.cbrn/rotations.ml.html

Source file rotations.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(* rotation amounts *)
type 'num t = 'num array

let make ~to_num i_0 i_1 i_2 i_3 i_4 i_5 i_6 i_7 = [|
  to_num i_0;
  to_num i_1;
  to_num i_2;
  to_num i_3;
  to_num i_4;
  to_num i_5;
  to_num i_6;
  to_num i_7;
|]

let zeros ~to_num =
  let z = to_num 0 in [|z;z;z;z;z;z;z;z;|]

let i t ~at = t.(at)
OCaml

Innovation. Community. Security.