Skip to content

CryptoRandom Class

Provides cryptographic random number generation.

C#
public static class CryptoRandom

Inheritance System.Object → CryptoRandom

Methods

CryptoRandom.GetRandomBytes(int) Method

Generates a specified number of random bytes.

C#
public static byte[] GetRandomBytes(int count);

Parameters

count System.Int32

The number of random bytes to generate.

Returns

System.Byte[]
An array of bytes filled with cryptographically strong random values.