Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1103 → Rev 1104

/trunk/includes/functions.inc.php
217,14 → 217,6
return array($out_html, $out_js, $out_css);
}
 
function hash_supported_natively($algo) {
if (version_compare(PHP_VERSION, '5.1.2') >= 0) {
return in_array($algo, hash_algos());
} else {
return false;
}
}
 
function sha3_512($password, $raw_output=false) {
if (hash_supported_natively('sha3-512')) {
return hash('sha3-512', $password, $raw_output);
233,16 → 225,6
}
}
 
function hash_hmac_supported_natively($algo): bool {
if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
return in_array($algo, hash_hmac_algos());
} else if (version_compare(PHP_VERSION, '5.1.2') >= 0) {
return in_array($algo, hash_algos());
} else {
return false;
}
}
 
function sha3_512_hmac($message, $key, $raw_output=false) {
// RFC 2104 HMAC
if (hash_hmac_supported_natively('sha3-512')) {
252,10 → 234,6
}
}
 
function hash_pbkdf2_supported_natively($algo) {
return hash_supported_natively($algo);
}
 
function sha3_512_pbkdf2($password, $salt, $iterations, $length=0, $binary=false) {
if (hash_pbkdf2_supported_natively('sha3-512')) {
return hash_pbkdf2('sha3-512', $password, $salt, $iterations, $length, $binary);