-1

i have to implement this hash function

"h(k)=((A*k)*mod(2^32))rsh(32-r)".

Where rsh(32-r) is right shifting a number. How can i do this right shifting. I am confused as i don't know how many times it will right shift the number ? Also it is not mentioned in my PDF. And also table size=m=2^r. Therefore r=logm. **It is mandatory to use this hash function.

rayan
  • 23
  • 1
  • 8

1 Answers1

0

Here the equivalent function:

uint32_t rsh(uint32_t num, uint8_t pad) {
     return num >> pad;
}

h = rsh((A*k)*mod(2^32), 32 - r);
GHugo
  • 2,584
  • 13
  • 14