Function pnet::packet::util::checksum

source ยท
pub fn checksum(data: &[u8], skipword: usize) -> u16
Expand description

Calculates a checksum. Used by ipv4 and icmp. The two bytes starting at skipword * 2 will be ignored. Supposed to be the checksum field, which is regarded as zero during calculation.