SystemCryptoRng Class
A cryptographically secure random number generator wrapping RandomNumberGenerator.
Namespace
RandN.Rngs
Interfaces
Base Types
  • object
SystemCryptoRng
object
ICryptoRng
IRng
IDisposable

Syntax

public sealed class SystemCryptoRng : ICryptoRng, IRng, IDisposable

Methods

NameReturn ValueSummary
Create()SystemCryptoRng
Creates a new instance of SystemCryptoRng.
static
Dispose()void
Fill(Span<byte>)void
Completely fills the span with random bytes.
GetFactory()SystemCryptoRng.Factory
Returns a singleton instance of SystemCryptoRng.Factory.
static
NextUInt32()uint
Returns the next 32 bits in the sequence as a UInt32.
NextUInt64()ulong
Returns the next 64 bits in the sequence as a UInt64.

Extension Methods

NameValueSummary
ShuffleInPlace<SystemCryptoRng, T>(IList<T>)void
Shuffles a list using the in-place Fisher-Yates shuffling algorithm.