Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultLength = 16
DefaultLength is the length chosen by Generate in case the passed length is smaller than MinLength.
View Source
const MaxLength = 2048
MaxLength is the maximum length for any password to be generated, hashed, or checked by functions in this package.
View Source
const MinLength = 10
MinLength is the minimum length for any password to be generated, hashed, or checked by functions in this package.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check compares the given password (plaintext) against some hash. It will return nil if password and hash match.
Types ¶
type InvalidPasswordLengthError ¶
type InvalidPasswordLengthError int
InvalidPasswordLengthError is returned by Hash and Check in case the given plaintext password is too short or too long. Generate is guaranteed to produce passwords that adhere to those limits.
func (InvalidPasswordLengthError) Error ¶
func (ipl InvalidPasswordLengthError) Error() string
Click to show internal directories.
Click to hide internal directories.