pota/use/randomSmall randomness helpers backed by crypto.getRandomValues — not
Math.random — plus a seeded LCG
(randomSeeded) for reproducibility.
random() is the module's base generator: a crypto-strength float in
[0, 1). The others draw on the same crypto source;
chance and
randomBetween also accept a custom
generator so you can swap in a seeded one for deterministic runs.
random() — crypto-strength float in [0, 1) (documented below)randomBetween(min?, max?, generator?)
— integer in [min, max], inclusiverandomColor(min?, max?) —
'rgb(r,g,b)' with each channel sampledrandomId() — base36 id stringchance(percent?, generator?) — true with
the given percentage probabilityrandomSeeded(seed) — deterministic
generator (linear-congruential)random() takes no arguments.
Returns: a number in [0, 1), read from
crypto.getRandomValues.
Reads one 32-bit value from crypto and scales it into [0, 1).
import { random } from 'pota/use/random'
random() // crypto-strength float in [0, 1)