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
| Name | Type | Description |
|---|---|---|
seed | number | 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.6011037519201636What it prints (run when this page was built)