API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classRandom

@codexo/exojs / math / stable

Seedable pseudo-random number generator using the xoshiro128** algorithm. xoshiro128** (Blackman & Vigna, 2018) keeps a compact 128-bit state — four 32-bit words — and produces high-quality 32-bit outputs that clear the full BigCrush / PractRand test batteries. It replaces the previous Mersenne Twister: ~16 bytes of state instead of ~2.5 KB, faster, and entirely 32-bit (no 64-bit arithmetic), which suits JavaScript well. The generator is deterministic: calling `setSeed(s)` followed by the same sequence of `next()` calls always produces the same output. Use `reset()` to replay from the current seed without changing it.

2
props
4
methods
0
events
Import
import { Random } from '@codexo/exojs'

Seedable pseudo-random number generator using the xoshiro128** algorithm.

xoshiro128** (Blackman & Vigna, 2018) keeps a compact 128-bit state — four 32-bit words — and produces high-quality 32-bit outputs that clear the full BigCrush / PractRand test batteries. It replaces the previous Mersenne Twister: ~16 bytes of state instead of ~2.5 KB, faster, and entirely 32-bit (no 64-bit arithmetic), which suits JavaScript well.

The generator is deterministic: calling `setSeed(s)` followed by the same sequence of `next()` calls always produces the same output. Use `reset()` to replay from the current seed without changing it.

Constructors 1
new(seed: number): Random
Methods 4
destroy(): void
next(min: number, max: number): number
reset(): this
setSeed(seed: number): this
Properties 2
seed: number
value: number
Source