pub unsafe fn sum_raw_be(data: *const u8, size: usize) -> u32 {
    let sdata        = slice::from_raw_parts(data as *const u16, size >> 1);
    let slice        = slice::from_raw_parts(data, size);
    let mut sum: u32 = 0;
    for w in sdata {
        sum = sum.wrapping_add(u16::from_be(*w) as u32);
    }
    
    if (size & 0x01) != 0 {
        sum.wrapping_add((slice[size - 1] as u32) << 8)
    } else {
        sum
    }
}
/// Sum given raw data as 16-bit unsigned big endian numbers.
Sum given raw data as 16-bit unsigned big endian numbers.
Sum given raw data as 16 - bit unsigned big endian numbers .
pub unsafe fn sum_raw_be(data: *const u8, size: usize) -> u32 {
    let sdata        = slice::from_raw_parts(data as *const u16, size >> 1);
    let slice        = slice::from_raw_parts(data, size);
    let mut sum: u32 = 0;
    for w in sdata {
        sum = sum.wrapping_add(u16::from_be(*w) as u32);
    }
    if (size & 0x01) != 0 {
        sum.wrapping_add((slice[size - 1] as u32) << 8)
    } else {
        sum
    }
}
pub unsafe fn sum_raw_be ( data : * const u8 , size : usize ) -> u32 { let sdata = slice :: from_raw_parts ( data as * const u16 , size >> 1 ) ; let slice = slice :: from_raw_parts ( data , size ) ; let mut sum : u32 = 0 ; for w in sdata { sum = sum . wrapping_add ( u16 :: from_be ( * w ) as u32 ) ; } if ( size & 0x01 ) != 0 { sum . wrapping_add ( ( slice [ size - 1 ] as u32 ) << 8 ) } else { sum } }
Sum given raw data as 16-bit unsigned big endian numbers.
Sum given raw data as 16 - bit unsigned big endian numbers .
data
*const u8
size
usize
data
*const u8
size
usize