Skip to content

Function: seededPrng()

ts
function seededPrng(seed): () => number;

SplitMix32 — a fast, high-quality 32-bit PRNG.

Passes BigCrush and PractRand. Unlike xorshift32, it has no weak bit patterns and produces well-distributed output across all bit widths.

Pure-logic helper — no three dependency, safe to load from the headless sim entry point and from any render code that needs a deterministic stream.

Usage: const rng = seededPrng('my-planet') const n = rng() // → float in [0, 1)

Parameters

ParameterType
seedstring

Returns

() => number

Distribué sous la licence indiquée dans le dépôt.