This chapter provides reference material for the CRC (Cyclic Redundancy Check) functions. It is divided into the following sections:
CRC Functions and Macros
The header file Crc.h
declares the API that this chapter describes.
CRC Functions and Macros
Crc16CalcBigBlock Function
Purpose
Calculate the 16-bit CRC (Cyclic Redundancy Check) of a large data block (> 64K bytes) using the table lookup method. A CRC is one of many mathematical ways of checking data for corruption, similar to a checksum but mathematically more complex.
Declared In
Crc.h
Prototype
uint16_t Crc16CalcBigBlock ( void*bufP
, uint32_tcount
, uint16_tcrc
)
Parameters
Returns
A 16-bit CRC for the data buffer.
See Also
Crc16CalcBlock
, Crc32CalcBlock
Crc16CalcBlock Function
Purpose
Calculate the 16-bit CRC (Cyclic Redundancy Check) of a data block using the table lookup method. A CRC is one of many mathematical ways of checking data for corruption, similar to a checksum but mathematically more complex.
Declared In
Declared In
Crc.h
Prototype
uint16_t Crc16CalcBlock ( const void*bufP
, uint16_tcount
, uint16_tcrc
)
Parameters
Returns
A 16-bit CRC for the data buffer.
Comments
The data block must be less than or equal to 64K bytes in length. For larger data blocks, use Crc16CalcBigBlock
. To obtain a 32-bit CRC value, use Crc32CalcBlock
.
Crc32CalcBlock Function
Purpose
Calculate the 32-bit CRC (Cyclic Redundancy Check) of a data block using the table lookup method. A CRC is one of many mathematical ways of checking data for corruption, similar to a checksum but mathematically more complex.
Declared In
Crc.h
Prototype
uint32_t Crc32CalcBlock ( const void*bufP
, uint16_tcount
, uint32_tcrc
)
Parameters
Returns
A 32-bit CRC for the data buffer.
Comments
The data block must be less than or equal to 64K bytes in length.
See Also
Crc16CalcBigBlock
, Crc16CalcBlock