Class Randomizer
Utility class for random values.
Inheritance
System.Object
Randomizer
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Randomizer : object
Methods
Next()
Returns a nonnegative random number.
Declaration
public int Next()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Next(Int32)
Returns a nonnegative random number less than the specified maximum.
Declaration
public int Next(int maxValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | maxValue | The maximum value (exclusive). |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Next(Int32, Int32)
Returns a random number within a specified range.
Declaration
public int Next(int minValue, int maxValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | minValue | The minimum value (inclusive). |
| System.Int32 | maxValue | The maximum value (exclusive). |
Returns
| Type | Description |
|---|---|
| System.Int32 |
NextBytes(Byte[])
Fills the elements of a specified array of bytes with random numbers.
Declaration
public void NextBytes(byte[] buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | The array of bytes to fill. |
NextDouble()
Returns a random number between 0.0 and 1.0.
Declaration
public double NextDouble()
Returns
| Type | Description |
|---|---|
| System.Double |
RandomString(Int32)
Generates a random string of a specified size.
Declaration
public string RandomString(int size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | size | The size of the output string. |
Returns
| Type | Description |
|---|---|
| System.String |