How the randomness works
Each click calls crypto.getRandomValues(new Uint8Array(1)) — a cryptographically secure pseudo-random number generator (CSPRNG) backed by the operating system's entropy pool. We map the value to yes / no with a 50/50 split (even byte → yes, odd byte → no). Across enough flips the distribution converges to exactly half-half.
Why not Math.random()?
Math.random() is fine for games and animations but isn't guaranteed to be unbiased — older browsers used predictable algorithms, and biased PRNGs can drift. For decision-making where fairness matters (especially when tracking outcomes), CSPRNG is the right choice.
Use cases
- Tie-breakers — who picks the restaurant, which child goes first, which feature gets shipped this sprint.
- Keeping yourself honest when overthinking — sometimes flipping a coin reveals what you wanted all along.
- Light-touch project decisions during retrospectives or team rituals.