range-unique-sampler

1.0.0 • Public • Published

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))

Readme

Keywords

none

Package Sidebar

Install

npm i range-unique-sampler

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.91 kB

Total Files

9

Last publish

Collaborators

  • jgullstr