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