OpenSSL
class OpenSSL extends AbstractGenerator (View source)
Generates bytes using OpenSSL extension.
OpenSSL generator uses openssl_random_pseudo_bytes to generate bytes. Note that whether bytes generated by this function are secure or not is up to debate.
Methods
string|false
readBytes(int $count)
Reads bytes from the randomness source.
bool
isSupported()
Tells if the generator is supported by the operating system.
Details
in AbstractGenerator at line 15
string
getBytes(int $count)
Returns securely generated random bytes.
This method will always return the correct number of bytes that have been securely generated. If the bytes cannot be securely generated or if the correct number of bytes cannot be generated, the method MUST throw an exception.
at line 25
protected string|false
readBytes(int $count)
Reads bytes from the randomness source.
at line 20
bool
isSupported()
Tells if the generator is supported by the operating system.