PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
crc.h File Reference
#include <stddef.h>
#include <stdint.h>

Data Structures

struct  pbl_crc32_legacy
 Running state of the legacy checksum. More...
 

Macros

#define PBL_CRC32_RESIDUE   0x2144DF1CU
 CRC-32 of a message with its little-endian CRC-32 appended, when the message is intact.
 

Functions

uint8_t pbl_crc8 (uint8_t crc, const void *data, size_t len)
 CRC-8/OPENSAFETY.
 
uint8_t pbl_crc8_reversed (uint8_t crc, const void *data, size_t len)
 pbl_crc8() consuming data from its last byte to its first.
 
uint32_t pbl_crc32 (uint32_t crc, const void *data, size_t len)
 CRC-32/ISO-HDLC, as used by zlib and PNG.
 
void pbl_crc32_legacy_init (struct pbl_crc32_legacy *ctx)
 Start a legacy checksum.
 
void pbl_crc32_legacy_update (struct pbl_crc32_legacy *ctx, const void *data, size_t len)
 Feed data to a legacy checksum.
 
uint32_t pbl_crc32_legacy_finish (struct pbl_crc32_legacy *ctx)
 Finish a legacy checksum.
 
uint32_t pbl_crc32_legacy (const void *data, size_t len)
 Legacy checksum of a single buffer.