Philox4x32.FromKey Method

Definition

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

Overload List

FromKey(ReadOnlySpan<UInt32>) Creates a new Philox4x32 instance with the specified key and counter initialized to zero.
FromKey(ReadOnlySpan<UInt32>, ReadOnlySpan<UInt32>) Creates a new Philox4x32 instance with the specified key and counter.

FromKey(ReadOnlySpan<UInt32>)

Creates a new Philox4x32 instance with the specified key and counter initialized to zero.
C#
public static Philox4x32 FromKey(
	ReadOnlySpan<uint> key
)

Parameters

key  ReadOnlySpan<UInt32>
The 64-bit key (2 × 32-bit words).

Return Value

Philox4x32
A new Philox4x32 instance with the specified key and zero counter.

Remarks

This factory method directly sets the Philox key and initializes the counter to zero, providing direct access to the counter-based RNG's key/counter interface.

Exceptions

ArgumentExceptionThrown when key length is not exactly 2.

FromKey(ReadOnlySpan<UInt32>, ReadOnlySpan<UInt32>)

Creates a new Philox4x32 instance with the specified key and counter.
C#
public static Philox4x32 FromKey(
	ReadOnlySpan<uint> key,
	ReadOnlySpan<uint> counter
)

Parameters

key  ReadOnlySpan<UInt32>
The 64-bit key (2 × 32-bit words).
counter  ReadOnlySpan<UInt32>
The 128-bit counter (4 × 32-bit words).

Return Value

Philox4x32
A new Philox4x32 instance with the specified key and counter.

Remarks

This factory method directly sets the Philox key and counter, providing direct access to the counter-based RNG's key/counter interface.

Exceptions

ArgumentExceptionThrown when key or counter length is incorrect.

See Also