Tag

Math.random

0 views collected around this technical thread.

macrozheng
macrozheng
Jun 25, 2021 · Fundamentals

Mastering Java Random Number Generation: Random, ThreadLocalRandom, SecureRandom & Math

This article reviews four Java random number generation techniques—Random, ThreadLocalRandom, SecureRandom, and Math.random()—detailing their usage, underlying algorithms, thread‑safety, performance trade‑offs, and appropriate scenarios, helping developers choose the right tool for their applications.

JavaMath.randomRandom Number Generation
0 likes · 15 min read
Mastering Java Random Number Generation: Random, ThreadLocalRandom, SecureRandom & Math
360 Tech Engineering
360 Tech Engineering
Dec 16, 2019 · Information Security

Understanding Random Number Generation for Lottery Programs and Cryptographic Security in JavaScript

This article explains the differences between true and pseudo‑random numbers, why JavaScript's Math.random is unsuitable for secure lottery draws, and how to use the Web Crypto API's Crypto.getRandomValues with a provided code example to achieve cryptographically strong randomness.

Crypto.getRandomValuesJavaScriptMath.random
0 likes · 8 min read
Understanding Random Number Generation for Lottery Programs and Cryptographic Security in JavaScript