#include <hashfunction01.h>


hashfunction01::hashfunction01()
  : nloops(0) {}

hashfunction01::hashfunction01(uintc loops_)
  : nloops(loops_) {}


uintc hashfunction01::operator()( uintc key) const 
{
  uint h = key;
  uint i;

  assert(nloops!=0);

  for (i=0; i<nloops; ++i)
  {
    h += ~(h << 15);
    h ^=  (h >> 10);
    h +=  (h << 3);
    h ^=  (h >> 6);
    h += ~(h << 11);
    h ^=  (h >> 10);
  }

  return h;
}



