public function getSummaryHash(bool $rawBinary = false): string
    {
        /* Make a XOR-encrypted copy of the hash state to prevent PHP's
         * interned strings from overwriting the hash state and causing
         * corruption. */
        $len = Util::strlen($this->summaryHashState);
        $pattern = \random_bytes($len);
        $tmp = $pattern ^ $this->summaryHashState;

        $finalHash = SodiumCompat::crypto_generichash_final($this->summaryHashState);

        /* Restore hash state */
        $this->summaryHashState = $tmp ^ $pattern;
        if ($rawBinary) {
            return $finalHash;
        }
        return Base64UrlSafe::encode($finalHash);
    }
public function getSummaryHash(bool $rawBinary = false): string
    {
        /* Make a XOR-encrypted copy of the hash state to prevent PHP's
         * interned strings from overwriting the hash state and causing
         * corruption. */
        $len = Util::strlen($this->summaryHashState);
        $pattern = \random_bytes($len);
        $tmp = $pattern ^ $this->summaryHashState;

        $finalHash = SodiumCompat::crypto_generichash_final($this->summaryHashState);

        /* Restore hash state */
        $this->summaryHashState = $tmp ^ $pattern;
        if ($rawBinary) {
            return $finalHash;
        }
        return Base64UrlSafe::encode($finalHash);
    }
public function getSummaryHash ( bool $ rawBinary = false ) : string { /* Make a XOR-encrypted copy of the hash state to prevent PHP's
         * interned strings from overwriting the hash state and causing
         * corruption. */ $ len = Util :: strlen ( $ this -> summaryHashState ) ; $ pattern = \ random_bytes ( $ len ) ; $ tmp = $ pattern ^ $ this -> summaryHashState ; $ finalHash = SodiumCompat :: crypto_generichash_final ( $ this -> summaryHashState ) ; /* Restore hash state */ $ this -> summaryHashState = $ tmp ^ $ pattern ; if ( $ rawBinary ) { return $ finalHash ; } return Base64UrlSafe :: encode ( $ finalHash ) ; }
Get the summary hash

@param bool $rawBinary
@return string

@throws \Exception
Get the summary hash