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.220-beta+a56b2444ff27b37e053039e60f062b99378309bd
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