Random numbers are used internally for Math.random()
.
They are also used currently for random pivot selection in the
Array.prototype.sort()
implementation.
The default internal random number generator is xoroshiro128+ with SplitMix64 seed mixing. Shamir's three-op PRNG is used on low memory targets and when the compiler doesn't have 64-bit types. The generators are not suitable for serious statistics algorithms due to e.g. limited quality of the seed material, and are not at all suitable for cryptography.
You can replace the internal random number generator using the
DUK_USE_GET_RANDOM_DOUBLE
config option.