Philox 4x 64.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 Philox4x64 instance with the specified key and counter initialized to zero. |
| From | Creates a new Philox4x64 instance with the specified key and counter. |
FromKey(ReadOnlySpan<UInt64>)
Creates a new Philox4x64 instance with the specified key and counter initialized to zero.
public static Philox4x64 FromKey(
ReadOnlySpan<ulong> key
)Parameters
- key ReadOnlySpan<UInt64>
- The 128-bit key (2 × 64-bit words).
Return Value
Philox4x64A new Philox4x64 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<UInt64>, ReadOnlySpan<UInt64>)
Creates a new Philox4x64 instance with the specified key and counter.
public static Philox4x64 FromKey(
ReadOnlySpan<ulong> key,
ReadOnlySpan<ulong> counter
)Parameters
- key ReadOnlySpan<UInt64>
- The 128-bit key (2 × 64-bit words).
- counter ReadOnlySpan<UInt64>
- The 256-bit counter (4 × 64-bit words).
Return Value
Philox4x64A new Philox4x64 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. |