crypto_pwhash_str_needs_rehash example

return false;
    }

    public function needsRehash(string $hashedPassword): bool
    {
        if (\function_exists('sodium_crypto_pwhash_str_needs_rehash')) {
            return sodium_crypto_pwhash_str_needs_rehash($hashedPassword$this->opsLimit, $this->memLimit);
        }

        if (\extension_loaded('libsodium')) {
            return \Sodium\crypto_pwhash_str_needs_rehash($hashedPassword$this->opsLimit, $this->memLimit);
        }

        throw new LogicException('Libsodium is not available. You should either install the sodium extension or use a different password hasher.');
    }
}
/** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash() * @param string $hash * @param int $opslimit * @param int $memlimit * @return bool * * @throws SodiumException */
    function sodium_crypto_pwhash_str_needs_rehash($hash$opslimit$memlimit)
    {
        return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash$opslimit$memlimit);
    }
}
if (!is_callable('sodium_crypto_pwhash_str_verify')) {
    /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */
    
Home | Imprint | This part of the site doesn't use cookies.