ParagonIE_Sodium_Compat::crypto_pwhash_str_verify

Advertisement

Syntax Syntax

ParagonIE_Sodium_Compat::crypto_pwhash_str_verify( string $passwd, string $hash )

Parameters Parameters

$passwd

(string) (Required)

$hash

(string) (Required)

Return Return

(bool)

Source Source

File: wp-includes/sodium_compat/src/Compat.php

    public static function crypto_pwhash_str_verify($passwd, $hash)
    {
        ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1);
        ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2);

        if (self::useNewSodiumAPI()) {
            return (bool) sodium_crypto_pwhash_str_verify($passwd, $hash);
        }
        if (self::use_fallback('crypto_pwhash_str_verify')) {
            return (bool) call_user_func('\\Sodium\\crypto_pwhash_str_verify', $passwd, $hash);
        }
        // This is the best we can do.
        throw new SodiumException(
            'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP'
        );
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.