C# 클래스 GSF.Security.Cryptography.Random

Generates cryptographically strong random numbers.
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 메소드들

메소드 설명
Between ( double startNumber, double stopNumber ) : double

Generates a semi cryptographically strong random integer between specified values. i.e. [startNumber-stopNumber)

ByteBetween ( byte startNumber, byte stopNumber ) : byte

Generates a cryptographically strong 8-bit random integer between specified values. i.e. [startNumber-stopNumber)

GetBytes ( byte buffer ) : void

Fills an array of bytes with a cryptographically strong sequence of random values.

The length of the byte array determines how many cryptographically strong random bytes are produced.

This method is thread safe.

Int16Between ( short startNumber, short stopNumber ) : short

Generates a cryptographically strong 16-bit random integer between specified values. i.e. [startNumber-stopNumber)

Int24Between ( Int24 startNumber, Int24 stopNumber ) : Int24

Generates a cryptographically strong 24-bit random integer between specified values. i.e. [startNumber-stopNumber)

Int24Between ( System.UInt24 startNumber, System.UInt24 stopNumber ) : System.UInt24

Generates a cryptographically strong unsigned 24-bit random integer between specified values. i.e. [startNumber-stopNumber)

Int32Between ( int startNumber, int stopNumber ) : int

Generates a cryptographically strong 32-bit random integer between specified values. i.e. [startNumber-stopNumber)

Int64Between ( long startNumber, long stopNumber ) : long

Generates a cryptographically strong 64-bit random integer between specified values. i.e. [startNumber-stopNumber)

UInt16Between ( ushort startNumber, ushort stopNumber ) : ushort

Generates a cryptographically strong unsigned 16-bit random integer between specified values. i.e. [startNumber-stopNumber)

UInt32Between ( uint startNumber, uint stopNumber ) : uint

Generates a cryptographically strong unsigned 32-bit random integer between specified values. i.e. [startNumber-stopNumber)

UInt64Between ( ulong startNumber, ulong stopNumber ) : ulong

Generates a cryptographically strong unsigned 64-bit random integer between specified values. i.e. [startNumber-stopNumber)

비공개 메소드들

메소드 설명
GetRandomNumberLessThan ( int maxValue ) : int

Returns a cryptographically strong number that is less the the supplied value

A number less than a negative number rolls down to int.MinValue, then to int.MaxValue if 0 is provided, 0 is returned

GetRandomNumberLessThan ( long maxValue ) : long

Returns a cryptographically strong number that is less the the supplied value

A number less than a negative number rolls down to long.MinValue, then to long.MaxValue if 0 is provided, 0 is returned

GetRandomNumberLessThan ( uint maxValue ) : uint

Returns a cryptographically strong number that is less than the the supplied value

if 0 is provided, 0 is returned

GetRandomNumberLessThan ( ulong maxValue ) : ulong

Returns a cryptographically strong number that is less than the the supplied value

if 0 is provided, 0 is returned

메소드 상세

Between() 공개 정적인 메소드

Generates a semi cryptographically strong random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Between ( double startNumber, double stopNumber ) : double
startNumber double A that is the low end of our range.
stopNumber double A that is the high end of our range.
리턴 double

ByteBetween() 공개 정적인 메소드

Generates a cryptographically strong 8-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static ByteBetween ( byte startNumber, byte stopNumber ) : byte
startNumber byte A that is the low end of our range.
stopNumber byte A that is the high end of our range.
리턴 byte

GetBytes() 공개 정적인 메소드

Fills an array of bytes with a cryptographically strong sequence of random values.

The length of the byte array determines how many cryptographically strong random bytes are produced.

This method is thread safe.

The cryptographic service provider (CSP) cannot be acquired. buffer is null.
public static GetBytes ( byte buffer ) : void
buffer byte The array to fill with a cryptographically strong sequence of random values.
리턴 void

Int16Between() 공개 정적인 메소드

Generates a cryptographically strong 16-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Int16Between ( short startNumber, short stopNumber ) : short
startNumber short A that is the low end of our range.
stopNumber short A that is the high end of our range.
리턴 short

Int24Between() 공개 정적인 메소드

Generates a cryptographically strong 24-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Int24Between ( Int24 startNumber, Int24 stopNumber ) : Int24
startNumber Int24 A that is the low end of our range.
stopNumber Int24 A that is the high end of our range.
리턴 Int24

Int24Between() 공개 정적인 메소드

Generates a cryptographically strong unsigned 24-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Int24Between ( System.UInt24 startNumber, System.UInt24 stopNumber ) : System.UInt24
startNumber System.UInt24 A that is the low end of our range.
stopNumber System.UInt24 A that is the high end of our range.
리턴 System.UInt24

Int32Between() 공개 정적인 메소드

Generates a cryptographically strong 32-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Int32Between ( int startNumber, int stopNumber ) : int
startNumber int A that is the low end of our range.
stopNumber int A that is the high end of our range.
리턴 int

Int64Between() 공개 정적인 메소드

Generates a cryptographically strong 64-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static Int64Between ( long startNumber, long stopNumber ) : long
startNumber long A that is the low end of our range.
stopNumber long A that is the high end of our range.
리턴 long

UInt16Between() 공개 정적인 메소드

Generates a cryptographically strong unsigned 16-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static UInt16Between ( ushort startNumber, ushort stopNumber ) : ushort
startNumber ushort A that is the low end of our range.
stopNumber ushort A that is the high end of our range.
리턴 ushort

UInt32Between() 공개 정적인 메소드

Generates a cryptographically strong unsigned 32-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static UInt32Between ( uint startNumber, uint stopNumber ) : uint
startNumber uint A that is the low end of our range.
stopNumber uint A that is the high end of our range.
리턴 uint

UInt64Between() 공개 정적인 메소드

Generates a cryptographically strong unsigned 64-bit random integer between specified values. i.e. [startNumber-stopNumber)
The cryptographic service provider (CSP) cannot be acquired.
public static UInt64Between ( ulong startNumber, ulong stopNumber ) : ulong
startNumber ulong A that is the low end of our range.
stopNumber ulong A that is the high end of our range.
리턴 ulong