2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * The hash extension polyfills.
9 if (! defined('PHPMYADMIN')) {
13 /* Compatibility with PHP < 5.6 */
14 if (! function_exists('hash_equals')) {
16 * Timing attack safe string comparison
18 * @param string $a first string
19 * @param string $b second string
21 * @return boolean whether they are equal
23 function hash_equals($a, $b) {
24 $ret = strlen($a) ^
strlen($b);
25 $ret |
= array_sum(unpack("C*", $a ^
$b));