3 ms·
The behaviour of Math.random() is technically browser specific since the algorithm isn't specified, but I think all the big engines have settled on xorshift128+
by jsheard 2y ago
The behaviour of Math.random() is technically browser specific since the algorithm isn't specified, but I think all the big engines have settled on xorshift128+. That's probably good enough for most non-crypto things.
Still, if you want consistent quality and speed across all browsers current and future, you're better off bundling your own PRNG code. That's also necessary if you want a repeatable sequence from a specific seed value, neither of the browser built-in methods support that.
- deleted 2y ago[deleted]