random.generateBytes(options)

Note:

The content in this help topic pertains to SuiteScript 2.1.

Method Description

Cryptographically strong pseudorandom data.

Returns

Uint8Array

Supported Script Types

Client and server scripts

For additional information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/crypto/random Module

Since

2023.1

Parameters

Parameter

Type

Required/Optional

Description

options.size

number

required

The number of bytes to generate.

Syntax

Note:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/crypto/random Samples.

            // Add additional code
...
// generate 5 random bytes of data
var bytes = random.generateBytes({size: 5});
...
//Add additional code 

          

General Notices