Add hash macro fn
This commit is contained in:
parent
884a262f93
commit
2d7d27722c
1 changed files with 14 additions and 0 deletions
|
@ -49,4 +49,18 @@ static const char *UDPC_ERR_THREADFAIL_STR = "Failed to create thread";
|
||||||
|
|
||||||
#define UDPC_PACKET_MAX_SIZE 8192
|
#define UDPC_PACKET_MAX_SIZE 8192
|
||||||
|
|
||||||
|
// 5 8 2 7 3 6 1
|
||||||
|
// 3 2 5 1 8 7 6
|
||||||
|
#define UDPC_HASH32(x) ( \
|
||||||
|
( \
|
||||||
|
((x & 0xF8000000) >> 5) \
|
||||||
|
((x & 0x07F80000) >> 6) \
|
||||||
|
((x & 0x00060000) << 10) \
|
||||||
|
((x & 0x0001FC00) >> 4) \
|
||||||
|
((x & 0x00000380) << 22) \
|
||||||
|
((x & 0x0000007E) >> 1) \
|
||||||
|
((x & 0x00000001) << 21) \
|
||||||
|
) ^ 0x96969696 \
|
||||||
|
)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue