public function verify(string $hmac, self $auth, int $driftAllowance = 90) : bool
    {
        $drift = $this->getTimeDrift($auth->getDate());
        if ($drift === null || $drift >= $driftAllowance) {
            return false;
        }

        try {
            if (\sodium_memcmp($hmac, $auth->getHMAC()) === 0) {
                return true;
            }
        } catch (\SodiumException $e) {
            return false;
        }

        return false;
    }
public function verify(string $hmac, self $auth, int $driftAllowance = 90) : bool
    {
        $drift = $this->getTimeDrift($auth->getDate());
        if ($drift === null || $drift >= $driftAllowance) {
            return false;
        }

        try {
            if (\sodium_memcmp($hmac, $auth->getHMAC()) === 0) {
                return true;
            }
        } catch (\SodiumException $e) {
            return false;
        }

        return false;
    }
public function verify ( string $ hmac , self $ auth , int $ driftAllowance = 90 ) : bool { $ drift = $ this -> getTimeDrift ( $ auth -> getDate ( ) ) ; if ( $ drift === null || $ drift >= $ driftAllowance ) { return false ; } try { if ( \ sodium_memcmp ( $ hmac , $ auth -> getHMAC ( ) ) === 0 ) { return true ; } } catch ( \ SodiumException $ e ) { return false ; } return false ; }
Validates a provided HMAC against an auth object and a drift

@param string $hmac  byte[] HMAC
@param self $auth    Authorization object
@param integer $driftAllowance
@return boolean
Validates a provided HMAC against an auth object and a drift