mirror of
https://github.com/wneessen/go-hibp.git
synced 2024-11-26 14:45:08 +01:00
18 lines
354 B
Go
18 lines
354 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/wneessen/go-hibp"
|
|
)
|
|
|
|
func main() {
|
|
hc := hibp.New(hibp.WithPwnedPadding())
|
|
m, _, err := hc.PwnedPassApi.CheckPassword("test")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if m != nil && m.Count != 0 {
|
|
fmt.Printf("Your password with the hash %q was found %d times in the pwned passwords DB\n",
|
|
m.Hash, m.Count)
|
|
}
|
|
}
|