GitShow/sindresorhus/unique-random
sindresorhus

unique-random

Generate random numbers that are consecutively unique

by sindresorhus
Star on GitHubForknpm

JavaScript

119 stars16 forks4 contributorsQuiet · 2y agoSince 2013v4.0.0MIT

Meet the team

See all 4 on GitHub →
sindresorhus
sindresorhus23 contributions
Richienb
Richienb3 contributions
aweary
aweary1 contribution
BendingBender
BendingBender1 contribution

Languages

View on GitHub →
JavaScript91.8%
TypeScript8.2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
Richienb
Test when min == maxClosedIssue

(theoretically) If they are equal then the previous value will always be the same, so the program enters an infinite loop. I think it is a better fix to make it work with only one number anyways, as opposed to throwing an error since this could happen if min and max are generated by another source.

Richienb · 2y ago
sindresorhus
Add option to use all number from the range before repeating any numbersClosedIssue

This can be useful, for example, for a music shuffle functionality. It should also ensure numbers across boundaries don't overlap. This would also be useful for slideshows to ensure the images don't show like "image A, image F, image A, …".

sindresorhus · 2y ago
Richienb
Add exhaustive sampling and rename the default export to `consecutiveUniqueRandom`MergedPR

rfc Fixes #9

Richienb · 2y ago
Structured data for AI agents

Repository: sindresorhus/unique-random. Description: Generate random numbers that are consecutively unique Stars: 119, Forks: 16. Primary language: JavaScript. Languages: JavaScript (91.8%), TypeScript (8.2%). License: MIT. Latest release: v4.0.0 (2y ago). Open PRs: 0, open issues: 0. Last activity: 2y ago. Community health: 85%. Top contributors: sindresorhus, Richienb, aweary, BendingBender.

·@ofershap

Replace github.com with gitshow.dev