Skip to the content

Tane種

Reproduce numbers from a seed, shuffle or pick items, share a daily puzzle and resume a saved stream.

Tane means seed in Japanese. About the name

Contents

Reference · Streams, draws and seeds

fromTextfunction

A position from a line toText wrote, with any space around it. Null for anything else, or for a later format.

Import it

import { fromText } from "@johnmorrisdotca/tane";

Definition

function fromText(text: string): StreamPosition | null

Parameters

NameTypeDescription
textstring

Text to hash, validate or decode.

Returns

StreamPosition | null

A position from a line toText wrote, with any space around it. null for anything else, or for a later format.

Examples

import { fromText, toText } from "@johnmorrisdotca/tane";

const position = { seed: 42, draws: 3 };
console.log(fromText(toText(position)));
{ seed: 42, draws: 3 }

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tane 1.3.0.