---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

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

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

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：2分

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

このクラスにはコンストラクターはありません。メソッドは、静的オブジェクト 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 (包含的) と bound (排他的) 間の疑似ランダム整数を生成します。
{#GlideSRU-getSecureRandomIntBound__table_hjl_4q5_qr__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| bound | 数値 | 制限された値。 |
[表 : 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}

疑似ランダムの Long 値を生成します。
{#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


