Variations of CRC16-CCITT checksum algorithms.
More...
Variations of CRC16-CCITT checksum algorithms.
This provides implementations for multiple variations of CRC16 checks.
There is a more generalized version in CRC16 (lightweight), that does not optionally utilize a look-up table as these implementations can do (and is thus also far more memory efficient). Its caveat however is that it is slower by about factor 8 than these versions when enabling the look-up table.
- Note
- enable the
crc16_fast module for a look-up table based implementation that trades code size for speed.
|
| uint16_t | crc16_ccitt_kermit_update (uint16_t crc, const unsigned char *buf, size_t len) |
| | Update CRC16-CCITT-KERMIT. More...
|
| |
| uint16_t | crc16_ccitt_kermit_calc (const unsigned char *buf, size_t len) |
| | Calculate CRC16-CCITT-KERMIT. More...
|
| |
| uint16_t | crc16_ccitt_fcs_start (const unsigned char *buf, size_t len) |
| | Start a CRC16-CCITT-FCS / IBM-SDLC calculation. More...
|
| |
| static uint16_t | crc16_ccitt_fcs_update (uint16_t crc, const unsigned char *buf, size_t len) |
| | Update CRC16-CCITT-FCS / IBM-SDLC. More...
|
| |
| uint16_t | crc16_ccitt_fcs_finish (uint16_t crc, const unsigned char *buf, size_t len) |
| | Finalise CRC16-CCITT-FCS / IBM-SDLC. More...
|
| |
| uint16_t | crc16_ccitt_fcs_calc (const unsigned char *buf, size_t len) |
| | Calculate CRC16-CCITT-FCS / IBM-SDLC in one pass. More...
|
| |
| static uint16_t | crc16_ccitt_mcrf4xx_update (uint16_t crc, const unsigned char *buf, size_t len) |
| | Update CRC16-CCITT-MCRF4XX. More...
|
| |
| uint16_t | crc16_ccitt_mcrf4xx_calc (const unsigned char *buf, size_t len) |
| | Calculate CRC16-CCITT-MCRF4XX. More...
|
| |
| uint16_t | crc16_ccitt_false_update (uint16_t crc, const unsigned char *buf, size_t len) |
| | Update CRC16-CCITT-FALSE. More...
|
| |
| uint16_t | crc16_ccitt_false_calc (const unsigned char *buf, size_t len) |
| | Calculate CRC16-CCITT-FALSE. More...
|
| |
| static uint16_t | crc16_ccitt_aug_update (uint16_t crc, const unsigned char *buf, size_t len) |
| | Update CRC16-CCITT-AUG. More...
|
| |
| uint16_t | crc16_ccitt_aug_calc (const unsigned char *buf, size_t len) |
| | Calculate CRC16-CCITT-AUG. More...
|
| |
◆ crc16_ccitt_aug_calc()
| uint16_t crc16_ccitt_aug_calc |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Calculate CRC16-CCITT-AUG.
| Parameter | Value |
| Polynom | 0x1021 |
| Init | 0x1d0f |
| Refin | false |
| Refout | false |
| Xorout | 0x0000 |
| Check | 0xe5cc |
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Checksum of the specified memory area
◆ crc16_ccitt_aug_update()
| static uint16_t crc16_ccitt_aug_update |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinestatic |
Update CRC16-CCITT-AUG.
- Parameters
-
- Returns
- Checksum of the specified memory area based on the given start value
Definition at line 223 of file crc16_ccitt.h.
◆ crc16_ccitt_false_calc()
| uint16_t crc16_ccitt_false_calc |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Calculate CRC16-CCITT-FALSE.
| Parameter | Value |
| Polynom | 0x1021 |
| Init | 0xffff |
| Refin | false |
| Refout | false |
| Xorout | 0x0000 |
| Check | 0x29b1 |
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Checksum of the specified memory area
◆ crc16_ccitt_false_update()
| uint16_t crc16_ccitt_false_update |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Update CRC16-CCITT-FALSE.
- Parameters
-
- Returns
- Checksum of the specified memory area based on the given start value
◆ crc16_ccitt_fcs_calc()
| uint16_t crc16_ccitt_fcs_calc |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Calculate CRC16-CCITT-FCS / IBM-SDLC in one pass.
| Parameter | Value |
| Polynom | 0x1021 |
| Init | 0xffff |
| Refin | true |
| Refout | true |
| Xorout | 0xffff |
| Check | 0x906e |
| Residue | 0xf0b8 |
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Checksum of the specified memory area
◆ crc16_ccitt_fcs_finish()
| uint16_t crc16_ccitt_fcs_finish |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Finalise CRC16-CCITT-FCS / IBM-SDLC.
- Parameters
-
- Returns
- Checksum of the specified memory area based on the given start value.
◆ crc16_ccitt_fcs_start()
| uint16_t crc16_ccitt_fcs_start |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Start a CRC16-CCITT-FCS / IBM-SDLC calculation.
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Partial checksum of the specified memory area. To be finalised with crc16_ccitt_fcs_finish()
◆ crc16_ccitt_fcs_update()
| static uint16_t crc16_ccitt_fcs_update |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinestatic |
Update CRC16-CCITT-FCS / IBM-SDLC.
- Parameters
-
- Returns
- Partial checksum of the specified memory area based on the given start value. To be finalised with crc16_ccitt_fcs_finish()
Definition at line 97 of file crc16_ccitt.h.
◆ crc16_ccitt_kermit_calc()
| uint16_t crc16_ccitt_kermit_calc |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Calculate CRC16-CCITT-KERMIT.
| Parameter | Value |
| Polynom | 0x1021 |
| Init | 0x0000 |
| Refin | true |
| Refout | true |
| Xorout | 0x0000 |
| Check | 0x2189 |
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Checksum of the specified memory area
◆ crc16_ccitt_kermit_update()
| uint16_t crc16_ccitt_kermit_update |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Update CRC16-CCITT-KERMIT.
- Parameters
-
- Returns
- Checksum of the specified memory area based on the given start value
◆ crc16_ccitt_mcrf4xx_calc()
| uint16_t crc16_ccitt_mcrf4xx_calc |
( |
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Calculate CRC16-CCITT-MCRF4XX.
| Parameter | Value |
| Polynom | 0x1021 |
| Init | 0xffff |
| Refin | true |
| Refout | true |
| Xorout | 0x0000 |
| Check | 0x6f91 |
- Parameters
-
| [in] | buf | Start of the memory area to checksum |
| [in] | len | Number of bytes to checksum |
- Returns
- Checksum of the specified memory area
◆ crc16_ccitt_mcrf4xx_update()
| static uint16_t crc16_ccitt_mcrf4xx_update |
( |
uint16_t |
crc, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinestatic |
Update CRC16-CCITT-MCRF4XX.
- Parameters
-
- Returns
- Checksum of the specified memory area based on the given start value
Definition at line 151 of file crc16_ccitt.h.