Generate random numbers that are consecutively unique
90
Creates a callable + iterable random number stream over an inclusive integer range, with configurable uniqueness guarantees.
Unique number streams support two strategies: 'cycle' (default) emits every in-range value once per cycle before any repeat, and 'no-repeat' only forbids back-to-back duplicates while sampling infinitely.
@generates
export type UniqueNumberStream = (() => number) & Iterable<number>;
export interface UniqueNumberStreamOptions {
strategy?: 'cycle' | 'no-repeat';
}
export function buildUniqueNumberStream(
minimum: number,
maximum: number,
options?: UniqueNumberStreamOptions
): UniqueNumberStream;Provides callable + iterable random number streams with range-bound uniqueness guarantees. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-unique-random