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.245-beta+94213ae9d4d0aa7a2c48e5398b12d267b99f868a
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