There are two categories of random number generators. True Random Number Generators (TRNGs) derive randomness from physical processes — atmospheric noise, radioactive decay, or thermal noise — and are theoretically unpredictable. Pseudo-Random Number Generators (PRNGs) use deterministic algorithms seeded with an initial value to produce sequences that appear random. CalkHub's generator uses crypto.getRandomValues(), a cryptographically secure PRNG seeded by the operating system's entropy sources (hardware interrupts, mouse movements, keystroke timings).
| Use Case | Recommended Generator | Why |
|---|---|---|
| Lottery / raffle draws | CSPRNG (this tool) | Statistically uniform, provably fair |
| Statistical sampling | CSPRNG (this tool) | Sufficient randomness, fast generation |
| Video games / dice | Any PRNG | Speed over perfect randomness |
| Cryptographic keys | Hardware TRNG | Must be unpredictable by any adversary |
| Scientific simulations | CSPRNG (this tool) | Good distribution, reproducible with seed |
Common Applications of Random Numbers
Random numbers appear in more places than most people realise. Online casinos use them for card shuffles and slot outcomes. Gaming platforms use them for loot drops, enemy spawns, and procedural world generation. Statistical software uses them for bootstrapping, cross-validation, and Monte Carlo simulations. Cryptographic systems depend on high-quality randomness for key generation, nonces, and initialisation vectors. In scientific research, randomisation ensures unbiased treatment assignment in clinical trials and fair sampling in population surveys. Each application requires a different level of randomness quality, and CalkHub's CSPRNG is suitable for all non-cryptographic uses and most statistical applications.
Why Cryptographic Seeding Matters
The crypto.getRandomValues() API draws entropy from the operating system's secure random source, which aggregates hardware noise — thermal fluctuations in CPU cores, timing variations in disk I/O, and network packet inter-arrival times. This means the random sequence cannot be predicted even if an attacker knows the algorithm, unlike older PRNGs such as Math.random() which can be reverse-engineered after observing a few hundred outputs. For any application where fairness, security, or statistical validity matters, a CSPRNG is the minimum acceptable standard.
For most everyday uses — classroom draws, game dice rolls, random team assignments, and statistical sampling — the generator on this page provides more than enough randomness quality. For cryptographic key generation or security-critical applications, however, always use a dedicated hardware security module or operating-system-level TRNG.