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 readable, I'm leaving the casts out)

MAC =  X_coordinate | Y_coordinate << 8 | lot << 16;

and throw away the top 16 bits of the lot and the top 8 bits of the coordinates. I feel though that maybe I should XOR in the top 16 bits of the lot somewhere, but I have no experience with this in the real world.

Here is a sample of die revision information: little endian byte dump

lot/wafer ID    X coordinate    Y coordinate
C3 1B B0 46     20 00           22 00
CB 8B 94 46     14 00           32 00
CB 8B 94 46     27 00           1E 00
B9 F7 80 6F     20 00           08 00   

来源:https://stackoverflow.com/questions/20082130/hashing-a-64-bit-value-into-a-32-bit-mac-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!