RandomExtensions
Provides random data generation.
public static void GetItems<T>(this Random random, Span<T> buffer) where T : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)
Fills the buffer with random values of the specified type.
public static void GetItems<T>(this RandomNumberGenerator random, Span<T> buffer) where T : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)
Fills the buffer with random values of the specified type.
Generates non-negative integer.
public static T Next<T>(this Random random) where T : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)
Generates a random value of blittable type.
public static T Next<T>(this RandomNumberGenerator random) where T : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)
Generates a random value of blittable type.
Generates a random boolean value.
Generates a random boolean value.
public static void NextChars(this Random random, ReadOnlySpan<char> allowedChars, Span<char> buffer)
Generates a random set of characters.
public static void NextChars(this RandomNumberGenerator random, ReadOnlySpan<char> allowedChars, Span<char> buffer)
Generates a random set of characters.
Returns a random floating-point number that is in range [0, 1).
Generates a random string of the given length.
Generates a random string of the given length.
public static string NextString(this RandomNumberGenerator random, ReadOnlySpan<char> allowedChars, int length)
Generates a random string of the given length.
Generates a random string of the given length.
Gets the random element from the collection.
Chooses the random element in the span.
Randomizes elements in the list.