Hacker News new | past | comments | ask | show | jobs | submit login

TLDR; hash the hash with fast function, like fibonacci hash which is just single multiplication by a constant, then take lower bits as your bucket index.



No, you take the highest bits. The product is a fixed-point real fraction. The integer part has overflowed out of the machine word. 0..(2**64-1) represents 0.0<=x<1.0 Picking the n highest bits is like multiplying with 2**n and using the integer result.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: