All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
crc16.c File Reference
#include <stdint.h>
#include <stddef.h>
#include "crc16.h"
+ Include dependency graph for crc16.c:

Go to the source code of this file.


uint16_t fr_crc16_xmodem (uint8_t const *in, size_t in_len)
 CRC16 implementation according to CCITT standards. More...


static uint16_t const crc16_table [256]

Function Documentation

uint16_t fr_crc16_xmodem ( uint8_t const *  in,
size_t  in_len 

CRC16 implementation according to CCITT standards.

Note by antirez: this is actually the XMODEM CRC 16 algorithm, using the following parameters:

Name : "XMODEM", also known as "ZMODEM", "CRC-16/ACORN" Width : 16 bit Poly : 1021 (That is actually x^16 + x^12 + x^5 + 1) Initialization : 0000 Reflect Input byte : False Reflect Output CRC : False Xor constant to output CRC : 0000 Output for "123456789" : 31C3

[in]inData to perform CRC on.
[in]in_lenLength of data.
CRC16 of input data.

Definition at line 91 of file crc16.c.

+ Here is the caller graph for this function:

Variable Documentation

uint16_t const crc16_table[256]

Definition at line 34 of file crc16.c.