SeedSequence.Fill Method

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

Fill(Span<UInt32>) Fills a span of 32-bit unsigned integers with entropy values.
Fill(Span<UInt64>) Fills a span of 64-bit unsigned integers with entropy values.
Fill(UInt64[]) Fills an array of 64-bit unsigned integers with entropy values.

Fill(Span<UInt32>)

Fills a span of 32-bit unsigned integers with entropy values.
C#
public virtual void Fill(
	Span<uint> buffer
)

Parameters

buffer  Span<UInt32>
The span to fill with entropy values.

Remarks

This is the canonical fill method for 32-bit values. It defines the authoritative entropy stream by calling NextUInt32() for each element.

For PRNGs with 32-bit state elements, this is the most efficient initialization method.

Fill(Span<UInt64>)

Fills a span of 64-bit unsigned integers with entropy values.
C#
public virtual void Fill(
	Span<ulong> buffer
)

Parameters

buffer  Span<UInt64>
The span to fill with entropy values.

Remarks

This method derives 64-bit values by packing consecutive 32-bit values in little-endian order: each 64-bit value is formed from two consecutive calls to NextUInt32(), where the first call provides the lower 32 bits and the second call provides the upper 32 bits.

This ensures deterministic, portable behavior across all platforms. For PRNGs with 64-bit state elements, this is the most efficient initialization method.

  Caution

Each 64-bit value consumes two 32-bit entropy values from the stream. If you need to reproduce a specific sequence, be aware that mixing 32-bit and 64-bit fill operations will affect stream alignment.

Fill(UInt64[])

Fills an array of 64-bit unsigned integers with entropy values.
C#
public void Fill(
	ulong[] buffer
)

Parameters

buffer  UInt64[]
The array to fill with entropy values.

See Also