Philox 4x 32.From Key Method
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| From | Creates a new Philox4x32 instance with the specified key and counter initialized to zero. |
| From | 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.
public static Philox4x32 FromKey(
ReadOnlySpan<uint> key
)Parameters
- key ReadOnlySpan<UInt32>
- The 64-bit key (2 × 32-bit words).
Return Value
Philox4x32A 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
| Argument | Thrown when key length is not exactly 2. |
FromKey(ReadOnlySpan<UInt32>, ReadOnlySpan<UInt32>)
Creates a new Philox4x32 instance with the specified key and counter.
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
Philox4x32A 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
| Argument | Thrown when key or counter length is incorrect. |