code: func (state *UserState) GenerateUniqueConfirmationCode() (string, error) {
  	const maxConfirmationCodeLength = 100 // when are the generated confirmation codes unreasonably long
  	length := minConfirmationCodeLength
  	confirmationCode := cookie.RandomHumanFriendlyString(length)
  	for state.AlreadyHasConfirmationCode(confirmationCode) {
  		// Increase the length of the confirmationCode random string every time there is a collision
  		length++
  		confirmationCode = cookie.RandomHumanFriendlyString(length)
  		if length > maxConfirmationCodeLength {
  			// This should never happen
  			return confirmationCode, ErrOutOfConfirmationCodes
  		}
  	}
  	return confirmationCode, nil
  }
docs: // Generate a unique confirmation code that can be used for confirming users.