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

mulberry32function

A seeded stream: mulberry32(42) returns the same numbers every time it is made. The seed is read as an unsigned 32-bit integer, so any integer works and 2^32 + 1 is the same seed as 1.

Import it

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

Definition

function mulberry32(seed: number): Random

Parameters

NameTypeDescription
seednumber

The numeric seed, read as an unsigned 32-bit integer by the stream.

Returns

Random

A seeded stream: mulberry32(42) returns the same numbers every time it is made. The seed is read as an unsigned 32-bit integer, so any integer works and 2^32 + 1 is the same seed as 1.

Examples

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

console.log(mulberry32(42)());
0.6011037519201636

What it prints (run when this page was built)

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