31 lines
668 B
C
31 lines
668 B
C
/**
|
|
* @file di/crc.h
|
|
* @brief Cyclic-reduncancy checks
|
|
* @date Mar 23, 2016
|
|
* @author jjacobs
|
|
* @copyright 2016 Dual Inventive Technology Centre B.V.
|
|
*
|
|
* descr
|
|
*/
|
|
#ifndef INCLUDE_DI_CRC_H_
|
|
#define INCLUDE_DI_CRC_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** CRC-16-CCITT-FALSE, IV 0xffff, Poly 0x1021
|
|
* See http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.crc-16-ccitt-false
|
|
*/
|
|
uint16_t di_crc16_ccitt(const void *msg, size_t n);
|
|
|
|
uint16_t di_crc16_ccitt_new(void);
|
|
void di_crc16_ccitt_update(uint16_t *crc, const void *msg, size_t size);
|
|
uint16_t di_crc16_ccitt_digest(uint16_t crc);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* INCLUDE_DI_CRC_H_ */
|