package xoshiro

  1. Overview
  2. Docs
Xoshiro PRNGs as drop-in replacements for Stdlib.Random

Install

Dune Dependency

Authors

Maintainers

Sources

0.1.tar.gz
md5=189dfb19a24fea0fdfe9627e419eb55d
sha512=ee9ced16ea5ede0e567522e8d82e35f27924c9b922bcd342dc8becb3cf4f176b79ab77e30bf472ce61642e879552d309506b5652f411455023cb9aef5162d2ca

doc/src/splitmix64_pure/splitmix64_pure.ml.html

Source file splitmix64_pure.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let next x =
  let open Int64 in
  x := add !x 0x9e3779b97f4a7c15L;
  let z = !x in
  let z = mul (logxor z (shift_right_logical z 30)) 0xbf58476d1ce4e5b9L in
	let z = mul (logxor z (shift_right_logical z 27)) 0x94d049bb133111ebL in
	logxor z (shift_right_logical z 31)

include MakeRandom.Full64(struct
    type state = int64 ref
    let bits = next

    let new_state () = ref 0L
    let assign s1 s2 = s1 := !s2

    let init_size = 1
    let init state seed =
      state := seed.(0)

    let default_seed = 135801055
  end)
OCaml

Innovation. Community. Security.