title: Reason for the number 5381 in the DJB hash function?
body: <p>Can anyone tell me why the number 5381 is used in the DJB hash function?</p>
  <p>The DJB hash function is defined as:</p>
  <ul>
  <li><p>h<sub> 0</sub> = 5381</p>
  </li>
  <li><p>h<sub> i</sub> = 33h<sub> i - 1</sub> + s<sub> i</sub></p>
  </li>
  </ul>
  <p>Here's a C implementation:</p>
  <pre class="lang-c prettyprint-override"><code>unsigned int DJBHash(char* str, unsigned int len)
  {
     unsigned int hash = 5381;
     unsigned int i    = 0;
  
     for(i = 0; i &lt; len; str++, i++)
     {   
        hash = ((hash &lt;&lt; 5) + hash) + (*str);
     }   
  
     return hash;
  }
  </code></pre>