Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
patrickfav opened this issue Oct 20, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@patrickfav
Copy link
Owner

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);

@patrickfav patrickfav self-assigned this Oct 20, 2019
@patrickfav patrickfav added the enhancement New feature or request label Oct 20, 2019
@patrickfav patrickfav added this to the v1.0.0 milestone Oct 20, 2019
@patrickfav patrickfav changed the title Unify API to to Bcrypt.with() to be able to hash and verify from the same entrypoint Unify API Bcrypt.with() to be able to hash and verify from the same entrypoint Oct 20, 2019
@Indigo744
Copy link

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?).

@patrickfav
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants