title: How to write djb2 hashing function in C?
body: <p>I am not able to figure out how to write the djb3 hashing function on C.</p>
  <p>I searched the internet but I found it may be in C++...</p>
  <pre><code>unsigned long hash(unsigned char *str){
          unsigned long hash = 5381;
          int c;
  
          while (c = *str++)
              hash = ((hash &lt;&lt; 5) + hash) + c; /* hash * 33 + c */
  
          return hash;
      }
  </code></pre>
  <p>and if you can explain this to me I will be really thankful...</p>