Randombytes
Cryptographically secure random byte generation backed by the OS CSPRNG.
Exposes libsodium’s randombytes_buf for cases where raw random bytes are needed directly.
Summary
Functions
Section titled “Functions”Randombytes . buf ( size ) -> buffer
Returns a buffer of size random bytes from the OS CSPRNG.
Parameters
| size: number |
Returns
| buffer |
uniform
Section titled “uniform”Randombytes . uniform ( upperBound ) -> number
Returns a uniformly distributed random number in [0, upperBound) without modulo bias.
upperBound must be greater than 0.