2.5 KiB
@suaveplan/random
High-level cryptographically secure randomness for application use. This is the everyday random package — it wraps the CSPRNG with ergonomic helpers for every common randomness task: unique IDs (randomUUID v4, randomUUIDv7, randomULID, randomNanoid), random strings with eight charset presets, collection utilities (shuffle, choice, sample, weightedChoice), object utilities (randomKey, randomEntry, randomSubset), game primitives (coin, dice, roll), and a full suite of continuous and discrete statistical distributions (Normal, LogNormal, Binomial, Poisson, and eight more). Every function accepts an optional rng?: Rng — omit it for crypto-backed defaults, or pass a SeededRng from @suaveplan/pseudo-random for deterministic tests. Do not confuse with @suaveplan/pseudo-random (seeded, deterministic, for procedural generation) or @suaveplan/crypto (raw cryptographic byte generation).
When to use this skill
- Implementing or debugging code that imports
@suaveplan/random. - The task touches: see package README.
- You need API guidance for this package's exports.
Quick reference
import { /* see API Reference below */ } from "@suaveplan/random";
Dependencies
Workspace dependencies: @suaveplan/error, @suaveplan/pseudo-random, @suaveplan/types
Where to read more
This skill is intentionally short. The package's own documentation is the authoritative source — read these in order:
packages/foundation/random/README.md— overview, install, quick-start, module indexpackages/foundation/random/src/**/*.md— co-located docs per implementation file (Purpose, Features, Basic + Advanced examples, full API reference, Implementation notes — all packages ship ≥200 words per module)packages/foundation/random/package.jsonexportsmap — every subpath you can import from
When the user asks an API question, read the relevant co-located .md first; do not answer from training-data memory.
See also
@suaveplan/error@suaveplan/pseudo-random@suaveplan/types
This SKILL.md is auto-generated by suaveplan-skills/scripts/generate-skills.ts from the package's README. Do not edit by hand — re-run the generator after the README changes.