pub fn crc(bytes: &[u8]) -> u32 {
    let mut crc = 0xFFFF_FFFFu32;
    for b in bytes {
        let index = ((crc ^ u32::from(*b)) as u8) as usize;
        crc = (crc >> 8) ^ CRC32TABLE[index];
    }

    crc ^ 0xFFFF_FFFF
}
/// Calculate a Tuya CRC32 checksum for an array of bytes
Calculate a Tuya CRC32 checksum for an array of bytes
Calculate a Tuya CRC32 checksum for an array of bytes
pub fn crc(bytes: &[u8]) -> u32 {
    let mut crc = 0xFFFF_FFFFu32;
    for b in bytes {
        let index = ((crc ^ u32::from(*b)) as u8) as usize;
        crc = (crc >> 8) ^ CRC32TABLE[index];
    }
    crc ^ 0xFFFF_FFFF
}
pub fn crc ( bytes : & [ u8 ] ) -> u32 { let mut crc = 0xFFFF_FFFFu32 ; for b in bytes { let index = ( ( crc ^ u32 :: from ( * b ) ) as u8 ) as usize ; crc = ( crc >> 8 ) ^ CRC32TABLE [ index ] ; } crc ^ 0xFFFF_FFFF }
Calculate a Tuya CRC32 checksum for an array of bytes
Calculate a Tuya CRC32 checksum for an array of bytes
bytes
&[u8]
bytes
&[u8]