patrickfav/bcrypt

Unify API Bcrypt.with() to be able to hash and verify from the same entrypoint

patrickfav opened this issue · 2 comments

See discussion in #23

Talking about it, I think the interface of the lib a bit surprising. Why BCrypt.with()... is for hashing, and BCrypt.verifyer()... is for verifying?
It would really make more sense, from an external point of view, if we could simply do:
BCrypt.with(LongPasswordStrategies.truncate()).verify(pw, hash);

I like consistent API 😄

Note that you can keep retro-compatibility by keeping the BCrypt.verifyer() as only a wrapper around BCrypt.with() (and marking it as obsolete, if possible in Java?).

You are right, we can make it backward compatible. And of course I agree with you, a API should be consistent :)