tc39-transfer / proposal-random-functions

Proposal to add a Random namespace and several additional convenience functions for using randomness.
https://tc39-transfer.github.io/proposal-random-functions/
MIT License
3 stars 1 forks source link

`Random.bytes()`? #2

Open tabatkins opened 5 months ago

tabatkins commented 5 months ago

Many of the other languages feature the ability to get random bytes from their random class, often directly filling their equivalent of a byte array. Do we need Random.bytes()?

There already exists Crypto.getRandomValues(bytearray), but that specifically fills the bytearray with cryptographically strong random numbers.

I think this is especially useful for seeded-random, under the assumption that seeded-random and Random will get the same methods.