code: public static HashCode newHash(String input, HashFunction function) {
          return function.hashString(input, Charsets.UTF_8);
      }
docs: Creates a UTF-8 encoded hash using the hash function
  
  @param input string to encode
  @param function hash function to use
  @return the hash code