/// Calculates a CRC32 checksum of a byte buffer in the way the punt target does it.
Calculates a CRC32 checksum of a byte buffer in the way the punt target does it.
Calculates a CRC32 checksum of a byte buffer in the way the punt target does it .
pub(crate) fn crc32(buff: &[u8]) -> u32 {
    let mut crc = CRC::crc32mpeg2();
    for bytes in buff.chunks(4) {
        let mut word = vec![0u8; 4];
        word[..bytes.len()].copy_from_slice(&bytes);
        word.reverse();
        crc.digest(&word);
    }
    crc.get_crc() as u32
}
pub ( crate ) fn crc32 ( buff : & [ u8 ] ) -> u32 { let mut crc = CRC :: crc32mpeg2 ( ) ; for bytes in buff . chunks ( 4 ) { let mut word = vec ! [ 0u8 4 ] ; word [ .. bytes . len ( ) ] . copy_from_slice ( & bytes ) ; word . reverse ( ) ; crc . digest ( & word ) ; } crc . get_crc ( ) as u32 }
Calculates a CRC32 checksum of a byte buffer in the way the punt target does it.
Calculates a CRC32 checksum of a byte buffer in the way the punt target does it .
buff
&[u8]