C# Класс MpcLib.Common.StochasticUtils.SafeRandom

Implements a safe random number generator seeded using RNGCryptoServiceProvider. This RNG is safe meaning that the default seed value is time-independent so if more than one instance of it is created at the same "time", the random sequence generated by each instance is completely different (independent) from other instances'. WARNING: The sequence of random numbers generated by this method is NOT cryptographically-secure. DO NOT USE IN REAL SITUATIONS.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Next ( System.Numerics.BigInteger maxValue ) : System.Numerics.BigInteger
Next ( int minValue, int maxValue ) : int

Returns a random number within a specified range.

SafeRandom ( ) : System
SafeRandom ( int seed ) : System

Описание методов

Next() публичный метод

public Next ( System.Numerics.BigInteger maxValue ) : System.Numerics.BigInteger
maxValue System.Numerics.BigInteger
Результат System.Numerics.BigInteger

Next() публичный метод

Returns a random number within a specified range.
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. maxValue must be /// greater than or equal to minValue. ///
Результат int

SafeRandom() публичный метод

public SafeRandom ( ) : System
Результат System

SafeRandom() публичный метод

public SafeRandom ( int seed ) : System
seed int
Результат System