code: private static int hash(char []key, int length)
    {
      int hash = 17;
  
      for (int i = length - 1; i >= 0; i--) {
        char a = key[i];
  
        if ('A' <= a && a <= 'Z')
          a += 'a' - 'A';
        
        hash = 65537 * hash + a;
      }
  
      return hash;
    }
docs: Calculate the hash.