Seed Sequence.Fill Bytes Method
Fills a span of bytes with entropy values.
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public virtual void FillBytes(
Span<byte> buffer
)Parameters
Remarks
This method provides a deterministic byte-stream API using little-endian byte order for expanding 32-bit values. This is particularly useful for counter-based RNGs and cipher-based wrappers that require byte-level initialization (e.g., ChaCha keys/nonces).
The method fills as many complete 32-bit words as possible, then handles any remaining 1-3 bytes by extracting them from a final 32-bit word.