BlockBuffer32<TBlockRng> Class
Assists in implementing block based RNGs.
Namespace
RandN.Implementation
Interfaces
Base Types
  • object
BlockBuffer32<TBlockRng>
object
IRng

Syntax

public sealed class BlockBuffer32<TBlockRng> : IRng where TBlockRng : notnull, IBlockRngCore<uint>

Type Parameters

NameDescription
TBlockRng

Constructors

NameSummary
BlockBuffer32(TBlockRng)Constructs a new instance filled from rng.

Properties

NameProperty TypeSummary
BlockLengthint
The length of the block.
Indexint
The index to the location within the current block.

Methods

NameReturn ValueSummary
Fill(Span<byte>)void
Completely fills the span with random bytes.
GenerateAndSet(int)void
Generates and stores the next block and sets Index to index.
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<BlockBuffer32<TBlockRng>, T>(IList<T>)void
Shuffles a list using the in-place Fisher-Yates shuffling algorithm.