Pwned Passwords Save

🔐Go client library for checking values against compromised HIBP Pwned Passwords

Project README

pwned-passwords

GoDoc Build Status Go Report Card license

A light-weight Go client for checking compromised passwords against HIBP Pwned Passwords.

Installation

go get -u github.com/mattevans/pwned-passwords

Usage

package main

import (
    "fmt"
    "net/http"
    "os"
    "time"

    hibp "github.com/mattevans/pwned-passwords"
)

func main() {
    // Init a client.
    client := hibp.NewClient()

    // Optional: Use a custom http client
    client.SetHTTPClient(&http.Client{
        Timeout: 3 * time.Second,
    })
	
    // Check to see if your given string is compromised.
    pwned, err := client.Compromised("string to check")
    if err != nil {
        os.Exit(1)
    }

    if pwned {
        // Oh dear! 😱 -- You should avoid using that password
        fmt.Print("Found to be compromised")
    }
}

Contributing

If you've found a bug or would like to contribute, please create an issue here on GitHub, or better yet fork the project and submit a pull request!

Open Source Agenda is not affiliated with "Pwned Passwords" Project. README Source: mattevans/pwned-passwords
Stars
86
Open Issues
2
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating