public function isValid($secret)
    {
        if (!extension_loaded('hash')) {
            // @codeCoverageIgnoreStart
            throw new \Exception('Hash extension not loaded');
            // @codeCoverageIgnoreEnd
        }

        list($algo, $sig) = explode("=", $this->signature);

        if (!in_array($algo, hash_algos(), true)) {
            throw new \Exception("Hash algorithm '$algo' is not supported.");
        }

        $hash = hash_hmac($algo, $this->rawBody, $secret);

        return (md5($sig) === md5($hash));
    }