verifyPassword

Verify a passwod with a hash string.

This will attempt to determine the correct algorithm from a prefix in the hash. If the prefix isn't known it will return false.

  1. bool verifyPassword(Algorithm alg, string password, string hash)
  2. bool verifyPassword(string password, string hash)
    bool
    verifyPassword
    (
    string password
    ,
    string hash
    )

Examples

auto hash = Scrypt.hashPassword("password", Scrypt.interactivePwHashConfig);
assert(verifyPassword("password", hash));
assert(!verifyPassword("bad pass", hash));
auto hash = Argon2.hashPassword("password", Argon2.interactivePwHashConfig);
assert(verifyPassword("password", hash));
assert(!verifyPassword("bad pass", hash));

Meta