tests if a given password has been pwned using the haveibeenpwned.com API.
inspired by the browser + node.js implementation here. see the why you should use this section from that repo for more info.
import (
"fmt"
"github.com/stripedpajamas/pwncheck"
)
func main() {
pwned, err := pwncheck.Pwned("helloworld")
if err != nil {
// errors out if not able to hit API
}
fmt.Println(pwned) // true
}
MIT