libxr 1.0
Want to be the best embedded framework
|
8 位循环冗余校验(CRC-8)计算类 / CRC-8 checksum computation class More...
#include <crc.hpp>
Static Public Member Functions | |
static void | GenerateTable () |
生成 CRC8 查找表 / Generates the CRC8 lookup table | |
static uint8_t | Calculate (const void *raw, size_t len) |
计算数据的 CRC8 校验码 / Computes the CRC8 checksum for the given data | |
static bool | Verify (const void *raw, size_t len) |
验证数据的 CRC8 校验码 / Verifies the CRC8 checksum of the given data | |
Static Public Attributes | |
static uint8_t | tab_ [256] |
CRC8 查找表 / CRC8 lookup table. | |
static bool | inited_ |
查找表是否已初始化 / Whether the lookup table is initialized | |
Static Private Attributes | |
static const uint8_t | INIT = 0xFF |
CRC8 初始值 / CRC8 initial value. | |
8 位循环冗余校验(CRC-8)计算类 / CRC-8 checksum computation class
该类实现了 CRC-8 校验算法,支持计算和验证数据的 CRC8 校验码。 This class implements the CRC-8 checksum algorithm, supporting computation and verification.
计算数据的 CRC8 校验码 / Computes the CRC8 checksum for the given data
raw | 输入数据指针 / Pointer to input data |
len | 数据长度 / Length of the data |
Definition at line 66 of file crc.hpp.
验证数据的 CRC8 校验码 / Verifies the CRC8 checksum of the given data
raw | 输入数据指针 / Pointer to input data |
len | 数据长度 / Length of the data |
true
,否则返回 false
/ Returns true
if the checksum is valid, otherwise returns false
Definition at line 91 of file crc.hpp.
|
inlinestatic |
|
inlinestatic |