Skip to main content

verify_trailing_crc

Function verify_trailing_crc 

Source
pub(crate) fn verify_trailing_crc(frame: &[u8]) -> bool
Expand description

Verify the trailing two bytes of frame against a freshly computed CRC of everything before them.

Returns true if the CRC matches. Returns false if frame has fewer than 3 bytes (no room for at least one payload byte plus 2 CRC bytes).