NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #767 most downloaded on npm
Pure random number generator written in TypeScript
Last release 2 months ago
10 Jul 2026
Release timing varies
gaps range from 1 weeks to 13 months
Rarely documented
notes for 7 of 46 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
52 releases · first in 2018
34fbea4 ⚡️ Extend undefined-field-init fix to congruential32 and mersenne
👷 Specify pnpm version for install step in publish
👷 Specify pnpmversion for install step in publish (#1069)
pnpm (#1066)--compare mode for benchmarks (#1061)persist-credentials: false on checkout steps (#1059)pnpm configuration (#1058)npm stage publish (#1028)pnpm dlx with pnpm exec for pkg-pr-new (#1017)One column per quarter.
c309120 ⚡️ Compress Mersenne jump coefficients
cca8ab6 ⚡️ No compute at import time (pre-computed)
d9aa940 ⚡ Faster init for mersenne
99b7b16 ✨ Add uniformFloat64 distribution
No more main entry point — Replace barrel imports with subpath imports:
No more main entry point — Replace barrel imports with subpath imports:
-import { uniformIntDistribution, xoroshiro128plus } from 'pure-rand';
+import { uniformInt } from 'pure-rand/distribution/uniformInt';
+import { xoroshiro128plus } from 'pure-rand/generator/xoroshiro128plus';
rng is now the first argument — All functions now take the generator as the first parameter:
-uniformIntDistribution(1, 6, rng);
+uniformInt(rng, 1, 6);
Functions mutate rng in-place by default — The old "pure" functions (returning [value, nextRng] tuples) have been removed. Functions now directly return the generated value and mutate the generator. To get the old pure behavior, wrap with purify:
-const [value, nextRng] = uniformIntDistribution(1, 6, rng);
+import { purify } from 'pure-rand/utils/purify';
+const pureUniformInt = purify(uniformInt);
+const [value, nextRng] = pureUniformInt(rng, 1, 6);
Renamed distributions — Pure distribution names have been shortened:
| 7.x | 8.0 |
|---|---|
unsafeUniformIntDistribution |
uniformInt |
unsafeUniformBigIntDistribution |
uniformBigInt |
uniformIntDistribution |
purify(uniformInt) |
uniformBigIntDistribution |
purify(uniformBigInt) |
uniformArrayIntDistribution / unsafeUniformArrayIntDistribution |
(removed) |
fromState moved to dedicated exports — Restoring a generator from its state now uses a separate function:
-import prand from 'pure-rand';
-const rng = prand.xoroshiro128plus.fromState(state);
+import { xoroshiro128plusFromState } from 'pure-rand/generator/xoroshiro128plus';
+const rng = xoroshiro128plusFromState(state);
Dedicated JumpableRandomGenerator type — Generators supporting jump() now implement a separate JumpableRandomGenerator interface (extends RandomGenerator). If you need generators with jump() method, update the type:
-import type { RandomGenerator } from 'pure-rand/types/RandomGenerator';
+import type { JumpableRandomGenerator } from 'pure-rand/types/JumpableRandomGenerator';
uniformArrayInt (#868)fromState in dedicated export (#848)rng as first argument (#831)mersenne (#894)jump to congruential32 (#882)uniformInt on large ranges (#869)purify utils.npmignore (#878)assert by expect (#849)static (#825)Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →