Random number generator
Any range, with or without repeats, and a shareable seed for reproducible draws.
Leave empty for true randomness; set a seed to make a draw reproducible and auditable
How it works
Unseeded draws use crypto.getRandomValues, the browser's cryptographically secure
random source. Seeded draws use a deterministic xorshift generator, so the same seed always
produces the same sequence.
Why not Math.random
Math.random is a fast pseudorandom generator with no security guarantees — its
internal state can be recovered from a handful of outputs, making future values predictable.
That is irrelevant for a game and disqualifying for a prize draw.
With or without repeats
“No repeats” draws from a pool without replacement, like lottery balls — which is why the number you want cannot exceed the size of the range. Allowing repeats is like rolling a die repeatedly: each draw is independent, and duplicates are expected. In a group of 23 people, two sharing a birthday is more likely than not.
Making a draw provable
Publish the seed before the draw — a future block hash, a lottery result, a hash of the entrant list. Anyone can then reproduce your result and confirm nothing was rigged after the fact.