Fortinet white logo
Fortinet white logo

Script Reference Guide

Rand_hex(int)

Rand_hex(int)

Generates a random number in HEX. Returns a string, length is the <int>.

Syntax

Rand_hex(int);

Arguments

Name Description

Int

An integer which specifies the length of the returned string.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
b = rand_hex(15)
debug("-----rand_hex b = %s-----\n", b)
}
Result:
-----rand_hex b = 43474FB47A8A8C4-----

Supported Version

FortiADC version 5.2.x and later.

Rand_hex(int)

Rand_hex(int)

Generates a random number in HEX. Returns a string, length is the <int>.

Syntax

Rand_hex(int);

Arguments

Name Description

Int

An integer which specifies the length of the returned string.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
b = rand_hex(15)
debug("-----rand_hex b = %s-----\n", b)
}
Result:
-----rand_hex b = 43474FB47A8A8C4-----

Supported Version

FortiADC version 5.2.x and later.