randomgen.philox.Philox.seed

Philox.seed(seed=None, counter=None, key=None)

Seed the generator

This method is called when Philox is initialized. It can be called again to re-Seed the generator For details, see Philox.

Parameters:
seed=None

Random seed initializing the pseudo-random number generator. Can be an integer in [0, 2**64), array of integers in [0, 2**64), a SeedSequence instance or None (the default). If seed is None, data will be read from /dev/urandom (or the Windows analog) if available. If unavailable, a hash of the time and process ID is used.

counter=None

Counter to use in the Philox state. Can be either a Python int in [0, 2**256) or a 4-element uint64 array. If not provided, the counter is initialized at 0.

key=None

Key to use in the Philox state. Unlike seed, which is run through another RNG before use, the value in key is directly set. Can be either a Python int in [0, 2**128) or a 2-element uint64 array. key and seed cannot both be used.

Raises:

ValueError – If values are out of range for the PRNG.

Notes

The two representation of the counter and key are related through array[i] = (value // 2**(64*i)) % 2**64.