std/random/mod.ts
lionel-rowe 149839b60c
feat(random/unstable): basic randomization functions (#5626)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-09-05 14:17:10 +09:00

27 lines
665 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
/**
* Utilities for generating random numbers.
*
* ```ts
* import { randomIntegerBetween } from "@std/random";
* import { randomSeeded } from "@std/random";
* import { assertEquals } from "@std/assert";
*
* const prng = randomSeeded(1n);
*
* assertEquals(randomIntegerBetween(1, 10, { prng }), 3);
* ```
*
* @experimental **UNSTABLE**: New API, yet to be vetted.
*
* @module
*/
export * from "./between.ts";
export * from "./integer_between.ts";
export * from "./sample.ts";
export * from "./seeded.ts";
export * from "./shuffle.ts";