Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ClientTimeout specifies the timeout of the HTTP API Client in seconds ClientTimeout = 5 // ErrPassphraseEmpty indicates passphrase input was less than 1 character ErrPassphraseEmpty = errors.New("Passphrase Input Empty") )
Functions ¶
Types ¶
type CheckResult ¶
type CheckResult struct { Pwned bool // Pwned indicates if the pass given was found in previous breach Pass string // Pass returns the string passed to the function Score int // Score returns a 0-4 score of password strength, useful for gauge etc. CrackTimeSeconds float64 // CrackTimeSeconds indicates the estimated time to crack this password at ~ 10ms per guess in seconds CrackTimeDisplay string // CrackTimeDisplay indicates the estimated time in seconds to years or centuries to crack password at ~ 10ms per guess }
CheckResult is returned as a struct when calling CheckPass()
type Pwd ¶
type Pwd struct { Pwned bool // Pwned returns true if passphrase is found pwned via API Pass string // Pass returns the passphrase string passed to the function TimesPwned int // TimesPwned returns the number of times the passphrase was found in the database }
Pwd is returned as a struct pointer when calling CheckForPwnage()
func CheckForPwnage ¶
CheckForPwnage takes passphrase as string, sends request to API and returns Pwd and error
Click to show internal directories.
Click to hide internal directories.