Documentation
¶
Index ¶
- Constants
- Variables
- func HashPassword(password string) (hash, salt string, err error)
- func ValidatePasswordChange(currentPassword, newPassword, confirmPassword string) error
- func ValidatePasswordConfirmation(password, confirmation string) error
- func ValidatePasswordStrength(password string) error
- func VerifyPassword(password, hash, salt string) bool
Constants ¶
const ( Time = 1 Memory = config.Argon2Memory Threads = 4 KeyLen = 32 )
Argon2id parameters
const ( MinPasswordLength = 8 MaxPasswordLength = 128 )
Variables ¶
var StrengthRequirements = fmt.Sprintf( "Password must be between %d and %d characters.", MinPasswordLength, MaxPasswordLength)
StrengthRequirements is the full password rule text for user-facing errors.
Functions ¶
func HashPassword ¶
HashPassword hashes a password with a new random salt using Argon2id
func ValidatePasswordChange ¶
ValidatePasswordChange validates a password change operation
func VerifyPassword ¶
VerifyPassword verifies a password against a stored hash and salt
Types ¶
This section is empty.