RandomDecisionGenerator

Randomness methodology

For readers who want the full picture — from RNG choice to distribution testing.

Random number source

Every pick uses window.crypto.getRandomValues(new Uint32Array(1)), exposed by all modern browsers. This function taps the operating system\'s cryptographic RNG — the same source used to generate keys, tokens, and nonces. Its output is:

  • Unpredictable — you cannot infer future values from past ones.
  • Uniformly distributed — every value in the range has equal probability.
  • Fast — a single call takes microseconds.

For pick-one selection, we take a random Uint32 and modulo it by the list length. To eliminate the modulo bias that appears when the list length doesn\'t divide 2³² cleanly, we discard values above Math.floor(2^32 / listLength) × listLength and re-sample. In practice this rejection almost never fires, but it guarantees perfect uniformity.

Wheel-of-names spin animation

The wheel is a display layer, not a fairness layer. We pick first, then compute a target angle such that the pointer lands on the picked wedge, then animate the wheel via CSS transforms. The animation timing curve is cubic-bezier(0.22, 0.11, 0.15, 1) — a natural deceleration curve. The result is that the wheel feels physical without being biased.

Without-replacement mode

When enabled, the picker maintains an internal list of "still-in-the-hat" items. Each pick removes the chosen item until the hat is empty, then resets. Both the current hat state and the reset event are handled deterministically — no hidden bias.

Weighted picks

When weights are provided, we build a cumulative-probability array and sample from it using the same crypto RNG. Weights are floating-point and normalised, so a weight of 2.0 vs 1.0 doubles the probability, exactly.

Distribution testing

An automated test (scripts/qa/randomness.test.ts) draws hundreds of thousands of picks from the shared pick functions (list index, number range, shuffle position) and checks that every outcome comes up within the range a fair draw would produce. It runs before changes to the pickers are published.

Reproducibility for high-stakes draws

Live draws (e.g. school raffles, streamer giveaways) benefit from documented reproducibility. We recommend:

  1. Record the draw on video (screen-share works).
  2. Have a witness present.
  3. Save the URL — our shared results are permalinkable.
  4. Publish the T&Cs of the draw before running it.

See our How To Run A Fair Giveaway guide for the full playbook.

Third-party verification

Our picker code is not open source, but the crypto.getRandomValues path is a well-documented browser standard. Third-party libraries like random.org use TRNG (true random number generators) sourced from atmospheric noise; that is arguably more random but not more fair — for our use cases, cryptographic PRNG is indistinguishable.

What we don\'t do

  • We do not weight results toward affiliates or paid partners. There is no A/B test on the pick itself.
  • We do not use ML-driven "engagement optimisation" on the result. What you see is what the picker picked.
  • We do not remember your previous picks unless you enable "without replacement" mode explicitly.