title: Very basic MurmurHash questions: variable descriptions for len, key in C++ implementation
body: <p>I'm trying to adapt MurmurHash into a program built for a class, but I can't seem to find explicit confirmation about what the variables represent.</p>
  
  <p>I'm using the following as reference:</p>
  
  <pre><code>unsigned int MurmurHash2 ( const void * key, int len, unsigned int seed )
  {
      // 'm' and 'r' are mixing constants generated offline.
      // They're not really 'magic', they just happen to work well.
  
      const unsigned int m = 0x5bd1e995;
      const int r = 24;
  
      // Initialize the hash to a 'random' value
  
      unsigned int h = seed ^ len;
  
      // Mix 4 bytes at a time into the hash
  
      const unsigned char * data = (const unsigned char *)key;
  
      while(len &gt;= 4)
      {
          unsigned int k = *(unsigned int *)data;
  
          k *= m; 
          k ^= k &gt;&gt; r; 
          k *= m; 
  
          h *= m; 
          h ^= k;
  
          data += 4;
          len -= 4;
      }
  
      // Handle the last few bytes of the input array
  
      switch(len)
      {
      case 3: h ^= data[2] &lt;&lt; 16;
      case 2: h ^= data[1] &lt;&lt; 8;
      case 1: h ^= data[0];
              h *= m;
      };
  
      // Do a few final mixes of the hash to ensure the last few
      // bytes are well-incorporated.
  
      h ^= h &gt;&gt; 13;
      h *= m;
      h ^= h &gt;&gt; 15;
  
      return h;
  } 
  </code></pre>
  
  <p>As I understand it, hash functions will take some value and puts it into a hash table. Is "len" the size of the hash table and "key" the value to be hashed? </p>