State of an ISAAC-32 PRNG: two 256-word arrays plus three accumulators and a
cursor into the current batch of results. Create one with create.
ISAAC (Indirection, Shift, Accumulate, Add, Count) generates 256 words per
round and hands them out one at a time; next/sample refill the
batch automatically when it runs dry.
The state is a plain object, so it can be inspected,
cloned (to fork a sequence), or serialised. m/r are typed arrays, so a
structural clone (e.g. structuredClone) forks correctly; a shallow {...}
copy shares them and does not.
State of an ISAAC-32 PRNG: two 256-word arrays plus three accumulators and a cursor into the current batch of results. Create one with create.
ISAAC (Indirection, Shift, Accumulate, Add, Count) generates 256 words per round and hands them out one at a time; next/sample refill the batch automatically when it runs dry.
The state is a plain object, so it can be inspected, cloned (to fork a sequence), or serialised.
m/rare typed arrays, so a structural clone (e.g.structuredClone) forks correctly; a shallow{...}copy shares them and does not.