#include <boost/cstdint.hpp> // for boost::uintmax_t #include <boost/integer.hpp> // for boost::uint_t #include <cstddef> // for std::size_t namespace boost { template < std::size_t Bits, uintmax_t TruncPoly, uintmax_t InitRem, uintmax_t FinalXor, bool ReflectIn, bool ReflectRem > typename uint_t<Bits>::fast crc( void const *buffer, std::size_t byte_count ); }
该 boost::crc 函数模板在一次遍历中计算单个数据块的未扩展 CRC。它具有与 boost::crc_optimal 相同的模板参数列表,后者被用于实现。此函数免去您手动创建和使用 boost::crc_optimal 对象的麻烦。