getRandomBytes
getRandomBytes(
length):Uint8Array<ArrayBuffer>
Defined in: get-random-bytes.ts:24
Fills and returns a new Uint8Array of length cryptographically random
bytes, via crypto.getRandomValues.
Chunks internally at MAX_BYTES_PER_CALL: the Web Crypto API spec caps
a single getRandomValues call at 65,536 bytes and throws
QuotaExceededError beyond it — a limit callers should not have to know
about.
Parameters
Section titled “Parameters”length
Section titled “length”number
Returns
Section titled “Returns”Uint8Array<ArrayBuffer>
Throws
Section titled “Throws”When length is not a non-negative integer.