Hi all,
I understood the following is a simple integer hash function. But I din't understand
how it works?. For example if I pass 5100 as key to this function whit it'll return back to me!>
Please explain step by step (atleast for operator for +, ^, << , >> )
Thanks
-BAS.
unsigned int inthash(unsigned int key)
{
key += (key << 12);
key ^= (key >> 22);
key += (key << 4);
key ^= (key >> 9);
key += (key << 10);
key ^= (key >> 2);
key += (key << 7);
key ^= (key >> 12);
return key;
}
Start Free Trial