Click or drag to resize

RandomGetBytes Method

Fills an array of bytes with a cryptographically strong sequence of random values.

Namespace: GSF.Security.Cryptography
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public static void GetBytes(
	byte[] buffer
)
View Source

Parameters

buffer  Byte
The array to fill with a cryptographically strong sequence of random values.
Exceptions
ExceptionCondition
CryptographicExceptionThe cryptographic service provider (CSP) cannot be acquired.
ArgumentNullExceptionbuffer is null.
Remarks

The length of the byte array determines how many cryptographically strong random bytes are produced.

This method is thread safe.

See Also