3 ms·
Is most of this even necessary? Couldn't you get away with: function IV( $size, $ssl = false ) { if ( $ssl && function_exists( 'openssl_random_pseudo_byt
by eksith 13y ago
Is most of this even necessary?
Couldn't you get away with:
function IV( $size, $ssl = false ) {
if ( $ssl && function_exists( 'openssl_random_pseudo_bytes' ) ) {
return openssl_random_pseudo_bytes( $size, true );
}
return mcrypt_create_iv( $size, MCRYPT_DEV_URANDOM );
}
From the docs: http://it.php.net/manual/en/function.mcrypt-create-iv.php http://it.php.net/manual/en/function.mcrypt-create-iv.php
5.3.0 MCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM became available on Windows platforms.