Struct VerifyResult
- Namespace
- Argon2id.PasswordHasher
- Assembly
- Argon2id.PasswordHasher.dll
The outcome of an Argon2id password verification, combining whether the password matched with whether the stored hash should be re-derived using the hasher's current parameters.
public readonly record struct VerifyResult
Remarks
Prefer Verify(string, string) over calling VerifyPassword(string, string) and NeedsRehash(string) separately when you want both pieces of information from one call — the underlying PHC string is parsed once instead of twice.
On any failure (wrong password, malformed stored value, unavailable pepper), NeedsRehash is always false; there's nothing meaningful to rehash when we don't know what the right password is. Use Failed for an explicit fail sentinel.
Constructors
VerifyResult(bool, bool)
The outcome of an Argon2id password verification, combining whether the password matched with whether the stored hash should be re-derived using the hasher's current parameters.
public VerifyResult(bool Success, bool NeedsRehash)
Parameters
Successbooltrue if the supplied password matched the stored hash; otherwise false.
NeedsRehashboolWhen Success is true, indicates whether the stored hash was produced with weaker parameters (or a non-active pepper) than this hasher's current settings and should be replaced on the next successful login. Always false on failure.
Remarks
Prefer Verify(string, string) over calling VerifyPassword(string, string) and NeedsRehash(string) separately when you want both pieces of information from one call — the underlying PHC string is parsed once instead of twice.
On any failure (wrong password, malformed stored value, unavailable pepper), NeedsRehash is always false; there's nothing meaningful to rehash when we don't know what the right password is. Use Failed for an explicit fail sentinel.
Properties
Failed
The canonical failure result: Success = false, NeedsRehash = false.
public static VerifyResult Failed { get; }
Property Value
NeedsRehash
When Success is true, indicates whether the stored hash was produced with weaker parameters (or a non-active pepper) than this hasher's current settings and should be replaced on the next successful login. Always false on failure.
public bool NeedsRehash { get; init; }
Property Value
- bool
Success
public bool Success { get; init; }
Property Value
- bool