private function _compareMac($a, $b) {
        $result = "\x00";

        for ($i = 0; $i < $this->_macByteCount; $i++) {
            $result |= substr($a, $i, 1) ^ substr($b, $i, 1);
        }
        
        /* \x00 if equal, nonzero otherwise */
        return ($result === "\x00");
    }
private function _compareMac($a, $b) {
        $result = "\x00";

        for ($i = 0; $i < $this->_macByteCount; $i++) {
            $result |= substr($a, $i, 1) ^ substr($b, $i, 1);
        }
        
        /* \x00 if equal, nonzero otherwise */
        return ($result === "\x00");
    }
private function _compareMac ( $ a , $ b ) { $ result = "\x00" ; for ( $ i = 0 ; $ i < $ this -> _macByteCount ; $ i ++ ) { $ result |= substr ( $ a , $ i , 1 ) ^ substr ( $ b , $ i , 1 ) ; } /* \x00 if equal, nonzero otherwise */ return ( $ result === "\x00" ) ; }
Constant-time comparison function

Stolen and adapted from:
https://cryptocoding.net/index.php/Coding_rules#Compare_secret_strings_in_constant_time

DON'T MESS WITH THIS FUNCTION

returns boolean true on match, otherwise, false
Constant - time comparison function