title: Widely used hashing algorithm in Java for implementing Hash tables?
body: <p>I am implementing a basic HashTable data structure in Java without using collection framework and Arrays. </p>
  
  <p>I intend to use individual nodes whose reference I would store in an array.</p>
  
  <p>I am doing it this way:</p>
  
  <h1>Define a Node:</h1>
  
  <pre><code>class Node {
  
      private int data;
      private String key;
      private Node next;
      // Other helper methods
  }
  </code></pre>
  
  <h1>Create an array which would hold reference to pre-created Node objects:</h1>
  
  <pre><code>public class MyHashTable {
  
      private Node[] nodeArray = new Node[100];
  
      public MyHashTable() {
          for(int i=0 ; i&lt;100; i++) {
              nodeArray[i] = new Node();
          }
      }
  
      private int getIndex(String key) {
          long hashCode = key.hashCode();
          return  (int )hashCode%100;
      }
  
      // Other helper methods...
  }
  </code></pre>
  
  <p>For getting the hash-code, I am using the Java's inbuilt method -> hashCode().</p>
  
  <p>It seems to be working fine, however for the case in which the key is "second", it returns a negative hash code and because of which the programs terminates with an exception.</p>
  
  <h1>My question is:</h1>
  
  <p>Is there any standard hashing algorithm which I can use for hashing and which is widely used? I am writing for learning purpose. </p>