API for Cyclic Redundancy Checking
More...
|
| uint32_t __pure | net_crc32le (const uint8_t *data, int size) |
| | Calculate a "little-endian" CRC-32 over a block of data.
|
| |
| uint32_t __pure | net_crc32be (const uint8_t *data, int size) |
| | Calculate a "big-endian" CRC-32 over a block of data.
|
| |
| uint16_t __pure | net_crc16ccitt (const uint8_t *data, int size, uint16_t start) |
| | Calculate a CRC16-CCITT over a block of data.
|
| |
API for Cyclic Redundancy Checking
◆ net_crc16ccitt()
| uint16_t __pure net_crc16ccitt |
( |
const uint8_t * | data, |
|
|
int | size, |
|
|
uint16_t | start ) |
Calculate a CRC16-CCITT over a block of data.
- Note
- Based on code found online at http://www.ccsinfo.com/forum/viewtopic.php?t=24977
- Parameters
-
| data | The data to calculate over. |
| size | The size of the data, in bytes. |
| start | The value to start with. This could be a previous return value from this function (if continuing a previous calculation) or some initial seed value (typically 0xFFFF or 0x0000). |
- Returns
- The calculated CRC16-CCITT.
◆ net_crc32be()
| uint32_t __pure net_crc32be |
( |
const uint8_t * | data, |
|
|
int | size ) |
Calculate a "big-endian" CRC-32 over a block of data.
- Parameters
-
| data | The data to calculate over. |
| size | The size of the data, in bytes. |
- Returns
- The calculated CRC-32.
◆ net_crc32le()
| uint32_t __pure net_crc32le |
( |
const uint8_t * | data, |
|
|
int | size ) |
Calculate a "little-endian" CRC-32 over a block of data.
- Parameters
-
| data | The data to calculate over. |
| size | The size of the data, in bytes. |
- Returns
- The calculated CRC-32.