Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Cyclic Redundancy Check


Files

file  otCRC.h
 Cyclic Redundancy Check Library.

Modules

 Version History

Functions

unsigned char crc7 (unsigned char crc, const unsigned char *buffer, unsigned len)
 Calculate the CRC according to the polynomial: x^7 + x^3 + 1.
unsigned short crc16 (const void *buf, int len)
 CRC16 implementation acording to CCITT standards.

Detailed Description

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks
and storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a short check value attached,
based on the remainder of a polynomial division of their contents. On retrieval, the calculation is repeated and,
in the event the check values do not match, corrective action can be taken against data corruption.
CRCs can be used for error correction.
CRCs are so called because the check (data verification) value is a redundancy (it expands the message without adding information)
and the algorithm is based on cyclic codes. CRCs are popular because they are simple to implement in binary hardware,
easy to analyze mathematically, and particularly good at detecting common errors caused by noise in transmission channels.
Because the check value has a fixed length, the function that generates it is occasionally used as a hash function.
The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function, used in Ethernet and many other standards,
is the work of several researchers and was published in 1975.
From wikipedia: https://en.wikipedia.org/wiki/Cyclic_redundancy_check

Function Documentation

unsigned short crc16 const void *  buf,
int  len
 

Parameters:
buf Pointer to the data on which the CRC is to be calculated
len Data size
Returns:
CRC16

unsigned char crc7 unsigned char  crc,
const unsigned char *  buffer,
unsigned  len
 

Parameters:
crc Start value
buffer Pointer to the data on which the CRC is to be calculated
len Data size
Returns:
CRC7
footer

otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0