C# Class Thinktecture.IdentityModel.CryptoRandom

A class that mimics the standard Random class in the .NET Framework - but uses RNGCryptoServiceProvider internally.
Inheritance: System.Random
Exibir arquivo Open project: IdentityModel/Thinktecture.IdentityModel.v1 Class Usage Examples

Public Methods

Method Description
CryptoRandom ( ) : System

Initializes a new instance of the CryptoRandom class.

CryptoRandom ( Int32 ignoredSeed ) : System

Initializes a new instance of the CryptoRandom class.

Next ( ) : Int32

Returns a nonnegative random number.

Next ( Int32 maxValue ) : Int32

Returns a nonnegative random number less than the specified maximum.

Next ( Int32 minValue, Int32 maxValue ) : Int32

Returns a random number within a specified range.

NextBytes ( byte buffer ) : void

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

NextDouble ( ) : double

Returns a random number between 0.0 and 1.0.

Method Details

CryptoRandom() public method

Initializes a new instance of the CryptoRandom class.
public CryptoRandom ( ) : System
return System

CryptoRandom() public method

Initializes a new instance of the CryptoRandom class.
public CryptoRandom ( Int32 ignoredSeed ) : System
ignoredSeed System.Int32 seed (ignored)
return System

Next() public method

Returns a nonnegative random number.
public Next ( ) : Int32
return System.Int32

Next() public method

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

Next() public method

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

NextBytes() public method

Fills the elements of a specified array of bytes with random numbers.
/// is null. ///
public NextBytes ( byte buffer ) : void
buffer byte An array of bytes to contain random numbers.
return void

NextDouble() public method

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