Class ThreadSafeRandom
Random utility which can be used from background threads.
public static class ThreadSafeRandom
- Inheritance
-
objectThreadSafeRandom
Methods
Next(int, int)
Generates random int number within specified range.
public static int Next(int minInclusive, int maxExclusive)
Parameters
minInclusiveintMinimal value, inclusive.
maxExclusiveintMaximum value, exclusive.
Returns
- int
Random value in specified range.
NextBytes(byte[])
Fills passed buffer with random bytes.
public static void NextBytes(byte[] buffer)
Parameters
bufferbyte[]Buffer filled with random bytes.
NextChars(char[])
Fills passed buffer with random char values.
public static void NextChars(char[] buffer)
Parameters
bufferchar[]Buffer filled with random
charvalues.
NextLong(long, long)
Generates random long number within specified range.
public static long NextLong(long minInclusive, long maxExclusive)
Parameters
minInclusivelongMinimal value, inclusive.
maxExclusivelongMaximum value, exclusive.
Returns
- long
Random value in specified range.