class RandomGeneratorFactory (View source)

A factory for retrieving a random generator, based on the environment

Properties

static bool $forceNoOpensslRandomPseudoBytes For testing, openssl_random_pseudo_bytes() override; if true, treat as if openssl_random_pseudo_bytes() is not available
static bool $forceNoRandomBytes For testing, random_bytes() override; if true, treat as if random_bytes() is not available.

Methods

static bool
hasOpensslRandomPseudoBytes()

Returns true if the system has openssl_random_pseudo_bytes()

static bool
hasRandomBytes()

Returns true if the system has random_bytes()

getGenerator()

Returns a default random generator, based on the current environment

Details

static protected bool hasOpensslRandomPseudoBytes()

Returns true if the system has openssl_random_pseudo_bytes()

Return Value

bool

static protected bool hasRandomBytes()

Returns true if the system has random_bytes()

Return Value

bool

static RandomGeneratorInterface getGenerator()

Returns a default random generator, based on the current environment