pub fn internet_checksum(data: &[u8]) -> u16Expand description
Compute the 16-bit ones’ complement of the ones’ complement sum of data.
The result is in network byte order and is the value that should be written into a checksum field so that verifying the entire header (including the checksum field) yields zero.
For odd-length data, a virtual zero byte is appended for the final 16-bit word.