Adaptation of the xoshiro128++ rng in the rust rand crate.

Constructors

  • Expects a 128 bit (preferably random) number as the seed. If undefined, creates a seed with Math.random. Don't use 0 as a seed.

    Parameters

    • Optional seed: bigint

    Returns RNG

Methods

  • Returns a float in the range min (inclusive) to max (exclusive). Min and max default to 0 and 1 respectively.

    Parameters

    • Optional min: number
    • Optional max: number

    Returns number

  • Serializes the RNG state into a hexadecimal BigInt string.

    Returns string