random.bytes

Generates random bytes.

Note

The result is generated using the cryptographically secure random number generator.

Syntax

bytes(n)

Parameters

Return value

A Uint8Array containing random bytes.

Example

random.bytes(16)
Uint8Array [129, 156, 253, 28, 188, 111, 124, 122, 220, 89, 62, 47, 228, 83, 76, 56]