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