code: def _encode(values, salt, min_length, alphabet, separators, guards):
      
  
      len_alphabet = len(alphabet)
      len_separators = len(separators)
      values_hash = sum(x % (i + 100) for i, x in enumerate(values))
      encoded = lottery = alphabet[values_hash % len(alphabet)]
  
      for i, value in enumerate(values):
          alphabet_salt = (lottery + salt + alphabet)[:len_alphabet]
          alphabet = _reorder(alphabet, alphabet_salt)
          last = _hash(value, alphabet)
          encoded += last
          value %= ord(last[0]) + i
          encoded += separators[value % len_separators]
  
      encoded = encoded[:-1]  # cut off last separator
  
      return (encoded if len(encoded) >= min_length else
              _ensure_length(encoded, min_length, alphabet, guards, values_hash))
docs: Helper function that does the hash building without argument checks.