csum += csum >> 16;
csum ^= 0xffff;
DATA(packet)[start + 16] = csum >> 8;
- DATA(packet)[start + 17] = csum;
+ DATA(packet)[start + 17] = csum & 0xff;
break;
}
}
uint32_t hash = hash_seed;
for(int i = 0; i < 4; i++) {
- hash += fullwidth[i];
+ hash = wrapping_add32(hash, fullwidth[i]);
hash = wrapping_mul32(hash, 0x9e370001U);
}
uint32_t hash = hash_seed;
for(int i = 0; i < 3; i++) {
- hash += halfwidth[i];
+ hash = wrapping_add32(hash, halfwidth[i]);
hash = wrapping_mul32(hash, 0x9e370001U);
}