Class StrongNumberUtility
This utility class is designed to make cryptography strong number operations easier to work with.
Inheritance
Namespace: Cuemon.Security.Cryptography
Assembly: Cuemon.Security.dll
Syntax
public static class StrongNumberUtility
Methods
| Improve this DocGetRandomNumber()
Generates a nonnegative random number.
Declaration
public static int GetRandomNumber()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer greater than or equal to zero and less than System.Int32.MaxValue. |
GetRandomNumber(Int32)
Generates a nonnegative random number less than the specified maximum.
Declaration
public static int GetRandomNumber(int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxValue | The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to zero. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer greater than or equal to zero, and less than maxValue; that is, the range of return values ordinarily includes zero but not maxValue. However, if maxValue equals zero, maxValue is returned. |
GetRandomNumber(Int32, Int32)
Generates a random number within a specified range.
Declaration
public static int GetRandomNumber(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minValue | The inclusive lower bound of the random number returned. |
System.Int32 | maxValue | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer greater than or equal to minValue and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|