lib/garbler.go
func (g Garbler) password(req PasswordStrengthRequirements) (string, error) {
	//Step 1: Figure out settings
	letters := 0
	mustGarble := 0
	switch {
	case req.MaximumTotalLength > 0 && req.MaximumTotalLength > 6:
		letters = req.MaximumTotalLength - req.Digits - req.Punctuation
	case req.MaximumTotalLength > 0 && req.MaximumTotalLength <= 6:
		letters = req.MaximumTotalLength - req.Punctuation
		mustGarble = req.Digits
	case req.MinimumTotalLength > req.Digits+req.Punctuation+6:
		letters = req.MinimumTotalLength - req.Digits - req.Punctuation
	default:
		letters = req.MinimumTotalLength
	}
	if req.Uppercase > letters {
		letters = req.Uppercase
	}
	password := g.garbledSequence(letters, mustGarble)
	password = g.uppercase(password, req.Uppercase)
	password = g.addNums(password, req.Digits-mustGarble)
	password = g.punctuate(password, req.Punctuation)
	return password, nil
}
func (g Garbler) password(req PasswordStrengthRequirements) (string, error) {
	//Step 1: Figure out settings
	letters := 0
	mustGarble := 0
	switch {
	case req.MaximumTotalLength > 0 && req.MaximumTotalLength > 6:
		letters = req.MaximumTotalLength - req.Digits - req.Punctuation
	case req.MaximumTotalLength > 0 && req.MaximumTotalLength <= 6:
		letters = req.MaximumTotalLength - req.Punctuation
		mustGarble = req.Digits
	case req.MinimumTotalLength > req.Digits+req.Punctuation+6:
		letters = req.MinimumTotalLength - req.Digits - req.Punctuation
	default:
		letters = req.MinimumTotalLength
	}
	if req.Uppercase > letters {
		letters = req.Uppercase
	}
	password := g.garbledSequence(letters, mustGarble)
	password = g.uppercase(password, req.Uppercase)
	password = g.addNums(password, req.Digits-mustGarble)
	password = g.punctuate(password, req.Punctuation)
	return password, nil
}
//Generate a password given requirements