window.crypto.getRandomValues) using unbiased rejection sampling to eliminate modulo bias.BigInt to prevent floating-point precision loss.Generating an integer in the range $[\text{Min}, \text{Max}]$ using Math.floor(Math.random() * (Max - Min + 1)) suffers from two distinct problems in security-sensitive contexts:
Math.random() can be predicted if an attacker observes sufficient consecutive outputs.Our generator implements rejection sampling across a 32-bit unsigned integer array (Uint32Array). Any random number falling above the largest integer multiple of the range interval is discarded and re-drawn, guaranteeing perfect statistical uniformity across all numbers.
window.crypto.getRandomValues.Scenario: Creating an authentication OTP code.
Min: 100000 | Max: 999999 | Quantity: 1
Result: 749281
Produces a single cryptographically unpredictable 6-digit number.
Scenario: Conducting a fair raffle draw from a pool of 50 participants.
Min: 1 | Max: 50 | Quantity: 5 | Unique Only: Active | Sort: Ascending
Results: [7, 14, 23, 38, 49]
Draws 5 non-repeating numbers sorted in ascending order.