pub fn sum_to_checksum(sum: u32) -> u16 {
    let mut checksum = sum;
    while (checksum & 0xffff0000) != 0 {
        let hw   = checksum >> 16;
        let lw   = checksum & 0xffff;
        checksum = lw + hw;
    }
    
    !checksum as u16
}
/// Convert given 32-bit unsigned sum into 16-bit unsigned checksum.
Convert given 32-bit unsigned sum into 16-bit unsigned checksum.
Convert given 32 - bit unsigned sum into 16 - bit unsigned checksum .
pub fn sum_to_checksum(sum: u32) -> u16 {
    let mut checksum = sum;
    while (checksum & 0xffff0000) != 0 {
        let hw   = checksum >> 16;
        let lw   = checksum & 0xffff;
        checksum = lw + hw;
    }
    !checksum as u16
}
pub fn sum_to_checksum ( sum : u32 ) -> u16 { let mut checksum = sum ; while ( checksum & 0xffff0000 ) != 0 { let hw = checksum >> 16 ; let lw = checksum & 0xffff ; checksum = lw + hw ; } ! checksum as u16 }
Convert given 32-bit unsigned sum into 16-bit unsigned checksum.
Convert given 32 - bit unsigned sum into 16 - bit unsigned checksum .
sum
u32
sum
u32