$salt, int $opslimit, int $memlimit, int $alg = null): string { error_clear_last(); if ($alg !== null) { $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit, $alg); } else { $result = \sodium_crypto_pwhash($length, $password, $salt, $opslimit, $memlimit); } if ($result === false) { throw SodiumException::createFromPhpError(); } return $result; }