/** * Xoshiro128**: a seedable pseudo-random number generator by Blackman & Vigna (2018). * Recommended for reproducible randomness (testing, simulations, procedural generation). * * DO NOT USE when security matters — use the Web Crypto API (`crypto.getRandomValues`) instead. * * Xoshiro128** has a 2^128-1 period and passes BigCrush. * It uses pure 32-bit arithmetic (shifts, rotates, XOR, multiply) * making it very fast in JavaScript via `Math.imul`. * * Xoshiro128** passes all 11 distribution quality tests at 10M samples, * performing on par with `Math.random` (V8's xorshift128+): * * - mean, variance, chi-squared uniformity, Kolmogorov-Smirnov * - lag-1 through lag-8 autocorrelation * - runs test, gap test, permutation test (triples) * - bit-level frequency (bits 0-7) * - 2D serial pairs (25x25 through 200x200 grids) * - birthday spacings (Marsaglia parameters) * * Speed is near-native (~4% slower than `Math.random`) and ~18% faster than Alea * (~14.4M ops/sec vs ~15.0M and ~12.2M respectively). * * To reproduce: * * ```bash * npm run benchmark_random_quality # distribution tests (N=1M) * npm run benchmark_random_quality -- --deep # thorough (N=10M, multi-trial) * npm run benchmark_random # speed comparison * ``` * * @see https://prng.di.unimi.it/ * @see https://vigna.di.unimi.it/ftp/papers/ScrambledLinear.pdf * * @module */ export interface RandomXoshiro { (): number; uint32: () => number; fract53: () => number; version: string; seed: number; } /** * Seeded pseudo-random number generator using the Xoshiro128** algorithm. * DO NOT USE when security matters, use webcrypto APIs instead. * * @see https://prng.di.unimi.it/ */ export declare const create_random_xoshiro: (seed?: number) => RandomXoshiro; //# sourceMappingURL=random_xoshiro.d.ts.map