libsbp  v2.4.7

Cyclic redundancy checks. More...

Collaboration diagram for CRC:

Functions

u16 crc16_ccitt (const u8 *buf, u32 len, u16 crc)
 Calculate CCITT 16-bit Cyclical Redundancy Check (CRC16). More...
 

Detailed Description

Cyclic redundancy checks.

Function Documentation

u16 crc16_ccitt ( const u8 buf,
u32  len,
u16  crc 
)

Calculate CCITT 16-bit Cyclical Redundancy Check (CRC16).

This implementation uses parameters used by XMODEM i.e. polynomial is:

\[ x^{16} + x^{12} + x^5 + 1 \]

Mask 0x11021, not reversed, not XOR'd (there are several slight variants on the CCITT CRC-16).

Parameters
bufArray of data to calculate CRC for
lenLength of data array
crcInitial CRC value
Returns
CRC16 value

Definition at line 74 of file edc.c.

Here is the caller graph for this function: