Show / Hide Table of Contents

Class RandomNumber

Provides random number generator methods.

Inheritance
System.Object
RandomNumber
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ComponentSpace.Saml2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class RandomNumber

Methods

GenerateBase64UrlEncodedRandomString(Int32)

Generates a base64 URL encoded random string.

Declaration
public static string GenerateBase64UrlEncodedRandomString(int length = 32)
Parameters
Type Name Description
System.Int32 length

The length of the string.

Returns
Type Description
System.String

The base64 URL encoded random string.

GenerateRandomBytes(Int32)

Generates a random byte array.

Declaration
public static byte[] GenerateRandomBytes(int length = 32)
Parameters
Type Name Description
System.Int32 length

The length of the byte array.

Returns
Type Description
System.Byte[]

The random byte array.

GenerateRandomID(Int32)

Generates a random SAML identifier.

Declaration
public static string GenerateRandomID(int length = 32)
Parameters
Type Name Description
System.Int32 length

The length of the SAML identifier.

Returns
Type Description
System.String

The random SAML identifier

In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2017-2022. All rights reserved.