pub fn update_checksum(old_checksum: u16, old_value: u16, new_value: u16) -> u16Expand description
Incrementally update a one’s complement checksum when a 16-bit value changes.
Implements the algorithm from RFC 1624: HC’ = ~(~HC + ~m + m’)
where HC is the old checksum, m is the old value, and m’ is the new value. All arithmetic is one’s complement (16-bit with end-around carry).