C# Class Thinktecture.IdentityModel.CryptoRandom

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

Méthodes publiques

Méthode 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 méthode

Initializes a new instance of the CryptoRandom class.
public CryptoRandom ( ) : System
Résultat System

CryptoRandom() public méthode

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

Next() public méthode

Returns a nonnegative random number.
public Next ( ) : Int32
Résultat System.Int32

Next() public méthode

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.
Résultat System.Int32

Next() public méthode

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 .
Résultat System.Int32

NextBytes() public méthode

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.
Résultat void

NextDouble() public méthode

Returns a random number between 0.0 and 1.0.
public NextDouble ( ) : double
Résultat double