---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideSecureRandomUtil - スコープ指定、グローバル

# GlideSecureRandomUtil - スコープ指定、グローバル {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：1分

GlideSecureRandomUtil API は、整数、長整数、および文字列を生成するためのメソッドを提供します。

このクラスにはコンストラクターはありません。メソッドには、静的オブジェクト GlideSecureRandomUtil を介してアクセスします。GlideSecureRandomUtil クラスは、グローバルアプリケーションとスコープ対象アプリケーションの両方で使用できます。

## GlideSecureRandomUtil - getSecureRandomInt() {#ariaid-title2}

疑似ランダム整数を生成します。
{#GlideSRU-getSecureRandomInt__table_hjl_4q5_qr__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 1. パラメーター]

{#GlideSRU-getSecureRandomInt__table_hjl_4q5_qr} {#GlideSRU-getSecureRandomInt__table_ijl_4q5_qr__entry__2}

| タイプ | 説明 |
|-|-|
| 番号 | 擬似ランダムに生成された整数。 |
[表 : 2. 返される内容]

{#GlideSRU-getSecureRandomInt__table_ijl_4q5_qr}  

    gs.info(GlideSecureRandomUtil.getSecureRandomInt());

出力:

    1976146969

## GlideSecureRandomUtil - getSecureRandomIntBound(数値制限) {#ariaid-title3}

メソッドに渡す 0 (包含) と限界 (排他) 値の間の疑似ランダム整数を生成します。
{#GlideSRU-getSecureRandomIntBound__table_hjl_4q5_qr__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| バインド | 番号 | バインドされた値。 |
[表 : 3. パラメーター]

{#GlideSRU-getSecureRandomIntBound__table_hjl_4q5_qr} {#GlideSRU-getSecureRandomIntBound__table_ijl_4q5_qr__entry__2}

| タイプ | 説明 |
|-|-|
| 番号 | 擬似ランダムに生成された整数。 |
[表 : 4. 返される内容]

{#GlideSRU-getSecureRandomIntBound__table_ijl_4q5_qr}  

    gs.info(GlideSecureRandomUtil.getSecureRandomIntBound(100));

出力:

    55

## GlideSecureRandomUtil - getSecureRandomLong() {#ariaid-title4}

疑似ランダム長値を生成します。
{#GlideSRU-getSecureRandomLong__table_hjl_4q5_qr__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 5. パラメーター]

{#GlideSRU-getSecureRandomLong__table_hjl_4q5_qr} {#GlideSRU-getSecureRandomLong__table_ijl_4q5_qr__entry__2}

| タイプ | 説明 |
|-|-|
| 番号 | 擬似ランダムに生成された 64 ビット整数。 |
[表 : 6. 返される内容]

{#GlideSRU-getSecureRandomLong__table_ijl_4q5_qr}  

    gs.info(GlideSecureRandomUtil.getSecureRandomLong());

出力:

    792836514424092500

## GlideSecureRandomUtil - getSecureRandomString(数値長) {#ariaid-title5}

指定された長さのランダムな英数字の文字列を生成します。
{#GlideSRU-getSecureRandomString__table_hjl_4q5_qr__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| length | 番号 | 文字列の長さ (文字数)。 |
[表 : 7. パラメーター]

{#GlideSRU-getSecureRandomString__table_hjl_4q5_qr} {#GlideSRU-getSecureRandomString__table_ijl_4q5_qr__entry__2}

| タイプ | 説明 |
|-|-|
| 文字列 | ランダムに生成される文字列。 |
[表 : 8. 返される内容]

{#GlideSRU-getSecureRandomString__table_ijl_4q5_qr}  

    gs.info(GlideSecureRandomUtil.getSecureRandomString(12));

出力:

    1XzVI0sLfVlT


