| 1493 | #define DS4_DIST_TOKEN_HASH_PRIME 1099511628211ull |
| 1494 | |
| 1495 | static uint64_t dist_token_hash_update(uint64_t h, int token) { |
| 1496 | uint32_t t = (uint32_t)token; |
| 1497 | for (int i = 0; i < 4; i++) { |
| 1498 | h ^= (uint64_t)((t >> (i * 8)) & 0xffu); |
| 1499 | h *= DS4_DIST_TOKEN_HASH_PRIME; |
| 1500 | } |
| 1501 | return h; |
| 1502 | } |
| 1503 | |
| 1504 | static uint64_t dist_token_hash_update_span(uint64_t h, const int *tokens, uint32_t n_tokens) { |
| 1505 | for (uint32_t i = 0; i < n_tokens; i++) h = dist_token_hash_update(h, tokens[i]); |
no outgoing calls
no test coverage detected