"

BlockBuffer32<TBlockRng, TBlockCounter> Class

Summary

Assists in implementing seekable block based RNGs.
Namespace
RandN.Implementation
Interfaces
Base Types
  • object

Syntax

public sealed class BlockBuffer32<TBlockRng, TBlockCounter> : IRng 
    where TBlockRng : notnull, ISeekableBlockRngCore<uint, TBlockCounter> where TBlockCounter : IEquatable<TBlockCounter>

Type Parameters

NameDescription
TBlockRng
TBlockCounter

Constructors

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

Properties

NameValueSummary
BlockCounterTBlockCounter
The current block counter for the RNG.
BlockLengthint
The length of the generated block.
Indexint
The index to the location within the current block.

Methods

NameValueSummary
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.