jargon2-api icon indicating copy to clipboard operation
jargon2-api copied to clipboard

How to properly check if an encoded hash can be verified?

Open PinkieSwirl opened this issue 5 years ago • 0 comments

Currently I'm doing the following to check if the an encoded hash/password can be verified: verifier.hash(encodedHash).verifyEncoded() Since I have different encoders (not just argon2).

However this seems overkill and also may throw an exception for other reasons (e.g., empty password).

So my question is if there currently is a better way to achieve this trough the provided API? Or do you recommend implement a check myself (e.g., something like startsWith...)?

PinkieSwirl avatar Nov 02 '19 17:11 PinkieSwirl