Boost C++ 库

……世界上最受推崇且设计最专业的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

CRC 函数 - Boost C++ 函数库
PrevUpHomeNext
#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 对象的麻烦。


PrevUpHomeNext