npm / pure-rand
pure-rand
What changed in pure-rand 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-03.
9 breaking4 new APIs and options11 performance
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpure-rand 824 changes
Breaking changes 9
Functions mutate rng in place and return the generated value by default; the old pure tuple-returning functions have been removed.
Generators supporting jump() now implement a dedicated interface extending RandomGenerator.
The main entry point is removed; replace barrel imports with subpath imports for distributions, generators, and utilities.
Wrap a distribution function with purify to get the old pure behavior, returning a value and next-generator tuple.
All functions now take the generator as their first parameter.
uniformArrayInt and unsafeUniformArrayIntDistribution are removed.
The former unsafeUniformBigIntDistribution name is replaced by uniformBigInt; uniformBigIntDistribution's pure behavior is available through purify(uniformBigInt).
The former unsafeUniformIntDistribution name is replaced by uniformInt; uniformIntDistribution's pure behavior is available through purify(uniformInt).
Restore a generator from its state using a dedicated exported function instead of fromState on the generator.
New APIs and options 4
Implement jump for mersenne.
Adds the uniformFloat32 distribution.
Adds the uniformFloat64 distribution.
congruential32 gains a jump() method.
Performance 11
Restores next() speed by dropping undefined field initialization.
The next operation was sped up using parallel-LCG advance.
A bit-identical formula reassociation sped up uniformFloat64 by 7%.
The jump operation was sped up.
The jump operation was sped up.
The congruential32 generator is faster with imul.
Pre-computed values eliminate computation at import time.
Initialization is faster, reducing the cost of starting the mersenne generator.
Twisting is faster, improving mersenne generator performance.
Uses fewer memory allocations, reducing allocation overhead for the mersenne generator.
uniformInt is faster on large ranges.