5 const uint8_t* buf =
reinterpret_cast<const uint8_t*
>(raw);
14 crc =
tab_[(crc ^ *buf++) & 0xff];
21 const uint8_t* buf =
reinterpret_cast<const uint8_t*
>(raw);
30 crc = tab_[(crc ^ *buf++) & 0xff] ^ (crc >> 8);
37 const uint8_t* buf =
reinterpret_cast<const uint8_t*
>(raw);
46 crc = tab_[(crc ^ *buf++) & 0xff] ^ (crc >> 8);
53 const uint8_t* buf =
reinterpret_cast<const uint8_t*
>(raw);
62 crc = tab_[(crc ^ *buf++) & 0xff] ^ (crc >> 8U);
static uint16_t Calculate(const void *raw, size_t len)
计算数据的 CRC16 校验码 / Computes the CRC16 checksum for the given data
static uint32_t Calculate(const void *raw, size_t len)
计算数据的 CRC32 校验码 / Computes the CRC32 checksum for the given data
static uint64_t Calculate(const void *raw, size_t len)
计算数据的 CRC64 校验码 / Computes the CRC64 checksum for the given data
static const uint8_t INIT
CRC8 初始值 / CRC8 initial value.
static void GenerateTable()
生成 CRC8 查找表 / Generates the CRC8 lookup table
static bool inited_
查找表是否已初始化 / Whether the lookup table is initialized
static uint8_t Calculate(const void *raw, size_t len)
计算数据的 CRC8 校验码 / Computes the CRC8 checksum for the given data
static uint8_t tab_[256]
CRC8 查找表 / CRC8 lookup table.