GlideSecureRandomUtil - Scoped, Global
-
- UpdatedJan 30, 2025
- 1 minute read
- Yokohama
- API reference
The GlideSecureRandomUtil API provides methods for generating integers, long values, and strings.
There is no constructor for this class. Methods are accessed through the static object GlideSecureRandomUtil. The GlideSecureRandomUtil class is available in both global and scoped applications.
GlideSecureRandomUtil - getSecureRandomInt()
Generates a pseudo-random integer.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The pseudo-randomly generated integer. |
Example
GlideSecureRandomUtil - getSecureRandomIntBound(Number bound)
Generates a pseudo-random integer between 0 (inclusive) and the bound (exclusive) value that you pass into the method.
Name | Type | Description |
---|---|---|
bound | Number | The bound value. |
Type | Description |
---|---|
Number | The pseudo-randomly generated integer. |
Example
GlideSecureRandomUtil - getSecureRandomLong()
Generates pseudo-random long value.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | The pseudo-randomly generated 64-bit integer. |
Example
GlideSecureRandomUtil - getSecureRandomString(Number length)
Generates a random alpha-numeric String with the specified length.
Name | Type | Description |
---|---|---|
length | Number | The length of the string in number of characters. |
Type | Description |
---|---|
String | The randomly generated string. |