CodexPadFrameDecoder Arduino Lib 1.0.3
Loading...
Searching...
No Matches
crc8.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Functions

uint8_t crc8::Calculate (const uint8_t *data, const size_t size)
 Calculate the CRC-8 checksum of data (SAE J1850 standard).
 

Macro Definition Documentation

◆ _CRC8_H_

#define _CRC8_H_

Definition at line 4 of file crc8.h.

Function Documentation

◆ Calculate()

uint8_t crc8::Calculate ( const uint8_t * data,
const size_t size )

Calculate the CRC-8 checksum of data (SAE J1850 standard).

Parameters
[in]dataPointer to the data to be calculated.
[in]sizeLength of the data in bytes.
Returns
uint8_t The calculated CRC value.

Uses the standard CRC-8/SAE J1850 algorithm:

  • Polynomial: 0x1D (x^8 + x^4 + x^3 + x^2 + 1)
  • Initial value: 0xFF
  • Final XOR: 0xFF
  • No input/output reversal Internally uses a 256-byte lookup table for efficient computation.

Definition at line 28 of file crc8.cpp.