Implements API v2 of Troy Hunt's HIBP to check whether a given password has been exposed in a breach.
https://haveibeenpwned.com/API/v2#PwnedPasswords
- Add the dependency to your
shard.yml
:
dependencies:
pwned_password:
github: anamba/pwned_password.cr
- Run
shards install
require "pwned_password_check"
PwnedPassword.search("correct horse battery staple") # -> 2 (found in 2 breaches)
PwnedPassword.search("f7Yr,f9dffF?eKeDpjepGwcc") # -> nil (not found)
- Fork it (https://github.com/anamba/pwned_password/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Aaron Namba - creator and maintainer