C# 클래스 SecurityDriven.Inferno.CryptoRandom

Represents a *thread-safe*, cryptographically-strong, pseudo-random number generator (based on RNGCryptoServiceProvider). 2-4 times slower than System.Random (would've been 150 times slower without buffering).
상속: System.Random
파일 보기 프로젝트 열기: sdrapkin/SecurityDriven.Inferno

공개 메소드들

메소드 설명
Next ( ) : int

Returns a nonnegative random number.

Next ( int maxValue ) : int

Returns a nonnegative random number less than the specified maximum.

Next ( int minValue, int maxValue ) : int

Returns a random number within a specified range.

NextBytes ( int count ) : byte[]

Returns a new count-sized byte array filled with random bytes.

NextBytes ( byte buffer ) : void

Fills the elements of a specified array of bytes with random numbers.

NextBytes ( byte buffer, int offset, int count ) : void

Fills the specified byte array with a cryptographically strong random sequence of values.

NextDouble ( ) : double

Returns a random number between 0.0 and 1.0.

NextLong ( ) : long

Returns a nonnegative random number.

NextLong ( long maxValue ) : long

Returns a nonnegative random number less than the specified maximum.

NextLong ( long minValue, long maxValue ) : long

Returns a random number within a specified range.

비공개 메소드들

메소드 설명
CryptoRandom ( ) : System
GetRandomUInt ( ) : uint

Gets one random unsigned 32bit integer in a thread safe manner.

GetRandomULong ( ) : ulong

Gets one random unsigned 64bit integer in a thread safe manner.

NextBytesInternal ( ArraySegment bufferSegment ) : void
SanityCheck ( ) : void

메소드 상세

Next() 공개 메소드

Returns a nonnegative random number.
public Next ( ) : int
리턴 int

Next() 공개 메소드

Returns a nonnegative random number less than the specified maximum.
/// is less than zero. ///
public Next ( int maxValue ) : int
maxValue int The exclusive upper bound of the random number to be generated. must be greater than or equal to zero.
리턴 int

Next() 공개 메소드

Returns a random number within a specified range.
/// is greater than . ///
public Next ( int minValue, int maxValue ) : int
minValue int The inclusive lower bound of the random number returned.
maxValue int The exclusive upper bound of the random number returned. must be greater than or equal to .
리턴 int

NextBytes() 공개 메소드

Returns a new count-sized byte array filled with random bytes.
public NextBytes ( int count ) : byte[]
count int Array length.
리턴 byte[]

NextBytes() 공개 메소드

Fills the elements of a specified array of bytes with random numbers.
/// is null. ///
public NextBytes ( byte buffer ) : void
buffer byte The array to fill with cryptographically strong random bytes.
리턴 void

NextBytes() 공개 메소드

Fills the specified byte array with a cryptographically strong random sequence of values.
/// is null. ///
public NextBytes ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes to contain random numbers.
offset int
count int Number of bytes to generate (must be lte buffer.Length).
리턴 void

NextDouble() 공개 메소드

Returns a random number between 0.0 and 1.0.
public NextDouble ( ) : double
리턴 double

NextLong() 공개 메소드

Returns a nonnegative random number.
public NextLong ( ) : long
리턴 long

NextLong() 공개 메소드

Returns a nonnegative random number less than the specified maximum.
/// is less than zero. ///
public NextLong ( long maxValue ) : long
maxValue long The exclusive upper bound of the random number to be generated. must be greater than or equal to zero.
리턴 long

NextLong() 공개 메소드

Returns a random number within a specified range.
/// is greater than . ///
public NextLong ( long minValue, long maxValue ) : long
minValue long The inclusive lower bound of the random number returned.
maxValue long The exclusive upper bound of the random number returned. must be greater than or equal to .
리턴 long