integer-hashing

Hashing a 64-bit value into a 32-bit MAC address

强颜欢笑 提交于 2019-12-25 04:38:09
问题 I'm looking into suggestions on how to convert a 64-bit die revision field into a 32-bit MAC address I can use a for a wireless application to avoid collisions. The die information is struct { uint32_t lot; uint16_t X_coordinate; uint16_t Y_coordinate; } I don't know the range of coordinates, but based on a few samples, I think the coordinates are limited to < 256. That effectly reduces the space by 2 bytes. But the lot number is fully populated. I'm going to try this (pseudocode to make it

Hashing a set of integers in an order independent way

陌路散爱 提交于 2019-12-04 18:59:09
问题 I want to hash a set of integers such that the order of the integers don't have an effect on the computed hash value. i.e. H([32224,12232,564423]) == H([564423,32224,12232]) . The number of unique sets will be in the range of a few millions. Speed is very important , but I need to know the upperbound on collisions with a chosen approach. Wikipedia has a good section on hashing vectors, but I don't understand the math behind it to confidently implement them in code. I would appreciate if

Hashing a set of integers in an order independent way

你说的曾经没有我的故事 提交于 2019-12-03 12:27:15
I want to hash a set of integers such that the order of the integers don't have an effect on the computed hash value. i.e. H([32224,12232,564423]) == H([564423,32224,12232]) . The number of unique sets will be in the range of a few millions. Speed is very important , but I need to know the upperbound on collisions with a chosen approach. Wikipedia has a good section on hashing vectors , but I don't understand the math behind it to confidently implement them in code. I would appreciate if someone can explain the math involved with some code. Ideally, I would like the final hash to be of 32 bits