N/crypto/random Module

Note:

The N/crypto/random module is available for both client and server scripts, but server scripts need to use SuiteScript 2.1.

If you cannot update your server script code to SuiteScript 2.1, consider implementing a small RESTlet in SuiteScript 2.1 that uses N/crypto/random module and consuming it from your script with https.requestRestlet(options)

                                   

In This Help Topic

Use the N/crypto/random module to provide cryptographically-secure, pseudorandom generator methods.

N/crypto/random Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Method

random.generateBytes(options)

Uint8Array

Client and server scripts

Generates cryptographically strong pseudorandom set of bytes.

random.generateInt(options)

number

Client and server scripts

Method used to generate cryptographically strong pseudorandom number.

random.generateUUID()

string

Client and server scripts

Method used to generate a v4 Universally Unique Identifier using a cryptographically secure random number generator.

General Notices