一组函数模板和类模板,用于计算各种形式的循环冗余校验码 (CRC)。
Daryle Walker
1.5
Boost 软件许可,版本 1.0
包含各种 CRC 计算函数、函数对象类型和封装策略类型的声明(和定义)。
![]() |
警告 |
|---|---|
示例 CRC 计算器类型已根据 参数化 CRC 算法目录进行了核对。如果我发现有标准错误,就添加了新的类型别名。但是,为了向后兼容,错误的 |
![]() |
注意 |
|---|---|
其中引用了 Rocksoft™ 模型 CRC 算法,该算法在 Ross Williams 的文章“CRC: A Paper On CRCs”中进行描述,并链接到“A Painless Guide to CRC Error Detection Algorithms”。在其他文档块中将简称为“RMCA”。 |
BOOST_CRC_PARM_TYPE BOOST_CRC_OPTIMAL_NAME
namespace boost { template<std::size_t Bits> class crc_basic; template<std::size_t Bits, unspecified TruncPoly, unspecified InitRem, unspecified FinalXor, bool ReflectIn, bool ReflectRem> class crc_optimal; typedef crc_optimal< 16, 0x8005, 0, 0, true, true > crc_16_type; // Computation type for ARC|CRC-16|CRC-IBM|CRC-16/ARC|CRC-16/LHA standard. typedef crc_optimal< 16, 0x1021, 0xFFFF, 0, false, false > crc_ccitt_false_t; // Computation type for CRC-16/CCITT-FALSE standard. typedef crc_ccitt_false_t crc_ccitt_type; // Computation type for the CRC mistakenly called the CCITT standard. typedef crc_optimal< 16, 0x1021, 0, 0, true, true > crc_ccitt_true_t; typedef crc_optimal< 16, 0x8408, 0, 0, true, true > crc_xmodem_type; typedef crc_optimal< 16, 0x1021, 0, 0, false, false > crc_xmodem_t; // Computation type for the actual XMODEM|ZMODEM|CRC-16/ACORN standard. typedef crc_optimal< 32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true > crc_32_type; // Computation type for CRC-32|CRC-32/ADCCP|PKZIP standard. template<std::size_t Bits, unspecified TruncPoly, unspecified InitRem, unspecified FinalXor, bool ReflectIn, bool ReflectRem> unspecified crc(void const *, std::size_t); template<std::size_t Bits, unspecified TruncPoly> unspecified augmented_crc(void const *, std::size_t, unspecified = 0u); }