/** * Seeded pseudo-random number generator. * * Implementation: cyrb128 (string → 128-bit hash split into four 32-bit * uints) feeding sfc32 (small fast counter, 4 × 32-bit state → one float * per call). Both are public-domain PRNGs from the well-known * bryc/code reference collection; the exact byte-layout is ported * verbatim from the 2022-2024 TDC prototype (src/generator/Generator.ts) * so that TDC v1.x continues to produce byte-identical output for any * existing DSL file + seed pair. * * CRITICAL — bit-identical determinism across language implementations * depends on this module. See docs/vision/16-portability.md. Any change * here must be mirrored in the Python and Java implementations with * matching behaviour verified by the shared fixture test suite. * * Both the hashing and the generator use `Math.imul`, `>>> 0`, and * `| 0` to force 32-bit unsigned/signed arithmetic in JavaScript's * otherwise-float-only number type. Ports must carefully mirror these * operations in their own language's integer semantics. */ /** * Derive four 32-bit unsigned integers from a seed string. * * Exported for reuse (e.g. re-seeding) and for cross-language golden * value tests; most callers want `createPrng` instead. */ export declare function cyrb128(str: string): [number, number, number, number]; /** * Build an sfc32 generator from four 32-bit unsigned integer state * words. Each call returns a float in [0, 1). */ export declare function sfc32(a: number, b: number, c: number, d: number): () => number; /** * Create a deterministic pseudo-random float generator from a seed * string. Returns a zero-argument function; each invocation produces * the next float in [0, 1). * * The same seed always produces the same sequence of floats, across * all TDC language implementations (TypeScript, Python, Java). */ export declare function createPrng(seed: string): () => number; //# sourceMappingURL=prng.d.ts.map