Reference · Streams, draws and seeds
savedStreamfunction
A position as the object toJSON writes: the format, the seed, the draws and the state they come to.
Import it
import { savedStream } from "@johnmorrisdotca/tane";
Definition
function savedStream(position: StreamPosition): SavedStream
Parameters
| Name | Type | Description |
|---|---|---|
position | StreamPosition | The stream’s seed and nonnegative count of consumed draws. |
Returns
SavedStream
A position as the object toJSON writes: the format, the seed, the draws and the state they come to.
Examples
import { savedStream } from "@johnmorrisdotca/tane";
const position = { seed: 42, draws: 3 };
console.log(savedStream(position));{
format: 1,
generator: 'tane 1.3.0',
algorithm: 'mulberry32',
seed: 42,
draws: 3,
state: 1199730185
}What it prints (run when this page was built)