ChaCha Class
A cryptographically secure random number generator using the ChaCha algorithm.
Namespace
RandN.Rngs
Interfaces
Base Types
  • object
ChaCha
object
ISeekableRng<ChaCha.Counter>
ICryptoRng
IRng

Syntax

public sealed class ChaCha : ISeekableRng<ChaCha.Counter>, ICryptoRng, IRng

Properties

NameProperty TypeSummary
PositionChaCha.Counter
The current position of the RNG.

Methods

NameReturn ValueSummary
Create(ChaCha.Seed, uint)ChaCha
Creates a ChaCha RNG using the given seed and number of double rounds.
static
Create(ChaCha.Seed)ChaCha
Creates a ChaCha20 rng using the given seed.
static
Fill(Span<byte>)void
Completely fills the span with random bytes.
GetChaCha12Factory()ChaCha.Factory12
Gets the ChaCha12 factory.
static
GetChaCha20Factory()ChaCha.Factory20
Gets the ChaCha20 factory.
static
GetChaCha8Factory()ChaCha.Factory8
Gets the ChaCha8 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<ChaCha, T>(IList<T>)void
Shuffles a list using the in-place Fisher-Yates shuffling algorithm.