Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Util.Rnd

Summary

This class offers static functions which generate random numbers in a thread-safe manner.

Static methods

string
GenerateString(int length, string takeCharactersFrom = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", Random rnd = null)
Generates a random string of the specified length, taking characters from the specified arsenal of characters.
intReturns a random non-negative integer.
int
Next(int max)
Returns a non-negative random number less than max.
int
Next(int min, int max)
Returns a random integer between min (inclusive) and max (exclusive).
boolReturns a random boolean.
void
NextBytes(byte[] buffer)
Fills the specified buffer with random bytes.
byte[]
NextBytes(int count)
Returns a new array with the specified number of elements, filled with random bytes.
doubleReturns a random double between 0.0 and 1.0.
double
NextDouble(double min, double max)
Returns a random double between min and max. It is unclear whether min or max can ever be returned.
longReturns a random non-negative 64-bit integer.
void
Reset(int seed)
Resets the random number generator using the specified seed.