#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
对象的麻烦。