lib/password_strength.go
func MakeRequirements(password string) PasswordStrengthRequirements {
	pwd := []byte(password)
	reqs := PasswordStrengthRequirements{}
	reqs.MaximumTotalLength = len(password)
	reqs.MinimumTotalLength = len(password)
	for i := range pwd {
		switch {
		case unicode.IsDigit(rune(pwd[i])):
			reqs.Digits++
		case unicode.IsUpper(rune(pwd[i])):
			reqs.Uppercase++
		case unicode.IsPunct(rune(pwd[i])):
			reqs.Punctuation++
		}
	}
	return reqs
}
func MakeRequirements(password string) PasswordStrengthRequirements {
	pwd := []byte(password)
	reqs := PasswordStrengthRequirements{}
	reqs.MaximumTotalLength = len(password)
	reqs.MinimumTotalLength = len(password)
	for i := range pwd {
		switch {
		case unicode.IsDigit(rune(pwd[i])):
			reqs.Digits++
		case unicode.IsUpper(rune(pwd[i])):
			reqs.Uppercase++
		case unicode.IsPunct(rune(pwd[i])):
			reqs.Punctuation++
		}
	}
	return reqs
}
//Generate password requirements from an existing password.