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.253-beta+ffb7163c9e3b771705bc5b9aa3f09870f2cb9e2c
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