Mcrypt
class Mcrypt extends AbstractGenerator (View source)
Generates bytes using mcrypt extension.
Mcrypt generator creates secure random byte using the mcrypt_create_iv function. The generator can either use /dev/urandom or /dev/random as the randomness source for the function. Note that on windows based systems, the function resorts to windows specific random generator.
Methods
Reads bytes from the randomness source.
Creates new instance of Mcrypt generator.
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 36
protected string|false
readBytes(int $count)
Reads bytes from the randomness source.
at line 26
__construct(bool $urandom = true)
Creates new instance of Mcrypt generator.
at line 31
bool
isSupported()
Tells if the generator is supported by the operating system.