getRandomBytes()function

getRandomBytes(length: number): Bytes
ParamType
lengthnumber
The number of random bytes to generate. required
Return
Bytes
A Bytes (Uint8Array) of the requested length filled with random values.

Get cryptographically-random bytes from the platform crypto API.

Examples

getRandomBytes(16) // Uint8Array(16) [ ... ]