Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultCost is the default bcrypt cost
DefaultCost = 12
)
Variables ¶
View Source
var ( // ErrPasswordTooShort is returned when password is too short ErrPasswordTooShort = errors.New("password must be at least 8 characters long") // ErrPasswordTooLong is returned when password is too long ErrPasswordTooLong = errors.New("password must be at most 72 characters long") // ErrPasswordMismatch is returned when passwords don't match ErrPasswordMismatch = errors.New("passwords do not match") )
Functions ¶
func ComparePassword ¶
ComparePassword compares a password with a hash Returns true if the password matches the hash
func HashPassword ¶
HashPassword generates a bcrypt hash of the password
func ValidatePasswordStrength ¶
ValidatePasswordStrength validates password strength requirements
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.