GlideSecureRandomUtil - Scoped, Global
concept australia Updated Sep 10, 2026 1 min read c_GlideSecureRandomUtilScopedAPI.md
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.
Parent Topic:Server API reference
GlideSecureRandomUtil - getSecureRandomInt()
Generates a pseudo-random integer.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| Number | The pseudo-randomly generated integer. |
JavaScript
gs.info(GlideSecureRandomUtil.getSecureRandomInt());Output:
Text
1976146969GlideSecureRandomUtil - 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. |
JavaScript
gs.info(GlideSecureRandomUtil.getSecureRandomIntBound(100));Output:
Text
55GlideSecureRandomUtil - getSecureRandomLong()
Generates pseudo-random long value.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| Number | The pseudo-randomly generated 64-bit integer. |
JavaScript
gs.info(GlideSecureRandomUtil.getSecureRandomLong());Output:
Text
792836514424092500GlideSecureRandomUtil - 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. |
JavaScript
gs.info(GlideSecureRandomUtil.getSecureRandomString(12));Output:
Text
1XzVI0sLfVlT113 lines · 2.8 KB
--- title: GlideSecureRandomUtil - Scoped, Global description: The GlideSecureRandomUtil API provides methods for generating integers, long values, and strings.Generates a pseudo-random integer.Generates a pseudo-random integer between 0 \(inclusive\) and the bound \(exclusive\) value that you pass into the method.Generates pseudo-random long value.Generates a random alpha-numeric String with the specified length. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/c\_GlideSecureRandomUtilScopedAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-09-10" reading_time_minutes: 1 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # GlideSecureRandomUtil - Scoped, Global 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. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## GlideSecureRandomUtil - getSecureRandomInt\(\) Generates a pseudo-random integer. |Name|Type|Description| |----|----|-----------| |None| | | |Type|Description| |----|-----------| |Number|The pseudo-randomly generated integer.| ``` gs.info(GlideSecureRandomUtil.getSecureRandomInt()); ``` Output: ``` 1976146969 ``` ## 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.| ``` gs.info(GlideSecureRandomUtil.getSecureRandomIntBound(100)); ``` Output: ``` 55 ``` ## GlideSecureRandomUtil - getSecureRandomLong\(\) Generates pseudo-random long value. |Name|Type|Description| |----|----|-----------| |None| | | |Type|Description| |----|-----------| |Number|The pseudo-randomly generated 64-bit integer.| ``` gs.info(GlideSecureRandomUtil.getSecureRandomLong()); ``` Output: ``` 792836514424092500 ``` ## 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.| ``` gs.info(GlideSecureRandomUtil.getSecureRandomString(12)); ``` Output: ``` 1XzVI0sLfVlT ```
| title | GlideSecureRandomUtil - Scoped, Global |
| description | The GlideSecureRandomUtil API provides methods for generating integers, long values, and strings.Generates a pseudo-random integer.Generates a pseudo-random integer between 0 \(inclusive\) and the bound \(exclusive\) value that you pass into the method.Generates pseudo-random long value.Generates a random alpha-numeric String with the specified length. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/c\_GlideSecureRandomUtilScopedAPI.html |
| release | australia |
| product | Server API Reference |
| classification | server-api-reference |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Server API referenceAPI referenceAPI implementation and reference |