Skip to content

jgullstr/range-unique-sampler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

range-unique-sampler GitHub license

Sample random unique integers within a range.

Usage

import uniqueSampler from 'range-unique-sampler';

// Sample integers in range 100 (inclusive) - 500 (exclusive).
const sample = uniqueSampler(100,500);

sample() // 123
sample() // x:[100-499] \ 123

// Sample 50 unique integers 0-999.
const samples = Array.from({length: 50}, uniqueSampler(0,1000))

About

Sample random unique integers within a range

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published