@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
17 lines • 958 B
TypeScript
import type { IdSource } from '../../utils/ids.ts';
/** A first seed for a generator never assigned one, drawn from the
* workspace's id source, so every generator starts somewhere else, as
* bash's mixes in the time and each shell's own pid, and a seeded
* workspace replays it. */
export declare function initialSeed(ids: IdSource): number;
/** One step of bash's RANDOM generator: Park-Miller through
* Schrage's method, a zero state stepping from the fixed seed. */
export declare function stepState(state: number): number;
/** The `$RANDOM` value a state renders as in bash: the two 16-bit
* halves folded, keeping 15 bits. */
export declare function valueOf(state: number): number;
/** One `$RANDOM` draw: step until the value differs from the last one,
* as bash does, and return the new state with it. `last`
* is 0 after a seed. */
export declare function draw(state: number, last: number): [number, number];
//# sourceMappingURL=rng.d.ts.map