generateRandomBytes

Generates a random string using a cryptographically secure pseudorandom number generator. This string will contain characters that are not ASCII-safe, so some sort of encoding will be necessary.

This function is restricted. Use of this function in your script will require a manual review before it will execute on the Sentinel infrastructure.

Signatures

beacon.generateRandomBytes(byteCount);

Parameters

byteCount

The number of bytes to generate.

Return Values

Type Notes
String The desired number of randomly-generated bytes.

Examples

Generate a random base64 string

beacon.encodeBase64(beacon.generateRandomBytes(12));

See Also