WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Compat::crypto_pwhash() public WP 1.0

{} It's a method of the class: ParagonIE_Sodium_Compat{}

No Hooks.




$result = ParagonIE_Sodium_Compat::crypto_pwhash( $outlen, $passwd, $salt, $opslimit, $memlimit, $alg );
$outlen(int) (required)
$passwd(string) (required)
$salt(string) (required)
$opslimit(int) (required)
$memlimit(int) (required)
$alg *(int null)*

Default: null

Code of ParagonIE_Sodium_Compat::crypto_pwhash() WP 5.8.2

public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null)
    ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);
    ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);
    ParagonIE_Sodium_Core_Util::declareScalarType($salt,  'string', 3);
    ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4);
    ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5);

    if (self::useNewSodiumAPI()) {
        if (!is_null($alg)) {
            ParagonIE_Sodium_Core_Util::declareScalarType($alg, 'int', 6);
            return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg);
        return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit);
    if (self::use_fallback('crypto_pwhash')) {
        return (string) call_user_func('\\Sodium\\crypto_pwhash', $outlen, $passwd, $salt, $opslimit, $memlimit);
    // 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'