Function internet_checksum::checksum

source ·
pub fn checksum(bytes: &[u8]) -> [u8; 2]
Expand description

Compute the checksum of “bytes”.

checksum(bytes) is shorthand for:

let mut c = Checksum::new();
c.add_bytes(bytes);
c.checksum()