/** * Deterministic, seedable pseudo-random generator. * * The same generation logic must run in Node (when building a {@link Fingerprint}) * and — for in-page noise — inside the injected script. Keep this dependency-free * and self-contained so it can be stringified and shipped to the page verbatim * (see {@link prngSource}). */ /** Hash an arbitrary string to a 32-bit integer (xmur3). */ export declare function hashSeed(str: string): number; /** A small, fast, deterministic PRNG with a handful of convenience helpers. */ export declare class Rng { private state; constructor(seed: string | number); /** Next float in [0, 1) (mulberry32). */ next(): number; /** Integer in [min, max] inclusive. */ int(min: number, max: number): number; /** Float in [min, max). */ float(min: number, max: number): number; /** True with probability `p` (default 0.5). */ bool(p?: number): boolean; /** Pick one element from a non-empty array. */ pick(arr: readonly T[]): T; /** Fisher–Yates shuffle (returns a new array). */ shuffle(arr: readonly T[]): T[]; /** Pick `n` distinct elements (or all, if `n` exceeds length). */ sample(arr: readonly T[], n: number): T[]; } /** * Generate a random seed string. Uses Node's `crypto.randomBytes` when * available and falls back to `Math.random`-derived hex otherwise. */ export declare function randomSeed(): string; /** * Source code of a minimal mulberry32 RNG, for embedding inside the injected * page script. Returns a function body that, given a numeric seed, yields a * `() => number` generator. Kept byte-identical in spirit to {@link Rng.next} * so in-page noise matches the host's expectations. */ export declare function prngSource(): string; /** Source of the xmur3 string hash, for embedding in the page script. */ export declare function hashSource(): string; //# sourceMappingURL=prng.d.ts.map