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
| Name | Description |
|---|---|
| TBlockRng | |
| TBlockCounter |
Constructors
| Name | Summary |
|---|---|
| BlockBuffer32 | Constructs a new instance filled from rng. |
Properties
| Name | Property Type | Summary |
|---|---|---|
| BlockCounter | TBlockCounter | The current block counter for the RNG. |
| BlockLength | int | The length of the generated block. |
| Index | int | The index to the location within the current block. |
Methods
| Name | Return Value | Summary |
|---|---|---|
| Fill | void | Completely fills the span with random bytes. |
| GenerateAndSet | 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
| Name | Value | Summary |
|---|---|---|
| ShuffleInPlace | void | Shuffles a list using the in-place Fisher-Yates shuffling algorithm. From RngExtensions |