Boost C++ 库

...世界上最受推崇、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

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