Reference · Streams, draws and seeds
SavedStreamtype
A stream's position as toJSON writes it.
Import it
import type { SavedStream } from "@johnmorrisdotca/tane";
Definition
type SavedStream = {
format: typeof SAVE_FORMAT;
generator: string;
algorithm: "mulberry32";
seed: number;
draws: number;
state: number;
};
Members
| Name | Type | Description |
|---|---|---|
format | 1 | The shape of this object: |
generator | string | What wrote it, such as |
algorithm | "mulberry32" | The algorithm. Always |
seed | number | |
draws | number | |
state | number | The generator's state at that position: |
Examples
import type { SavedStream } from "@johnmorrisdotca/tane";
import { savedStream } from "@johnmorrisdotca/tane";
const value: SavedStream = savedStream({ seed: 42, draws: 3 });
console.log(value.state);1199730185What it prints (run when this page was built)