Hi
Looking for help!
hash_t HashKey::HashBytes(const void* bytes, int size) const
{
const unsigned char* cp = (const unsigned char*) bytes;
hash_t h = 0;//unsigned int
for ( int i = 0; i < size; ++i )
// Overflow is okay here.
h = (h >> 31) + (h << 1) + cp[i];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This arithmetic make sure there is no collision???
return h;
}
Have a nice day!
Ciao
Cloud