Skip to content

xoroshiro128StarStar(initialState): Xoroshiro128StarStar

Defined in: packages/prng/src/xoroshiro128-star-star.ts:90

Create a xoroshiro128** 1.0 pseudorandom number generator.

The two input words are reduced modulo 2^64. They must not both reduce to zero because the all-zero state is fixed and would only emit zeroes. Each call to next() runs in constant time, mutates the private 128-bit state, and returns the same unsigned 64-bit value as the reference C implementation.

jump() advances by 2^64 outputs and longJump() advances by 2^96 outputs. Both run in constant space and a fixed 128 state transitions.

This generator is not cryptographically secure. Use crypto.getRandomValues() when unpredictability matters.

Xoroshiro128StarStarState

Two integers representing the initial 64-bit state words.

Xoroshiro128StarStar

A generator with private state and fixed-distance jump operations.

With code INVALID_STATE when the state does not contain two bigints or both words reduce to zero modulo 2^64.