package xoshiro

  1. Overview
  2. Docs

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.