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