From: Matthew Barr Date: Thu, 4 May 2017 00:37:45 +0000 (+1000) Subject: hsbench: use boost:crc for db filename X-Git-Tag: v4.5.0^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12298568e64d9d51b3d3ffcdb7c0639a64a6b14;p=thirdparty%2Fvectorscan.git hsbench: use boost:crc for db filename --- diff --git a/tools/hsbench/engine_hyperscan.cpp b/tools/hsbench/engine_hyperscan.cpp index eadc1cc4..9674e5c8 100644 --- a/tools/hsbench/engine_hyperscan.cpp +++ b/tools/hsbench/engine_hyperscan.cpp @@ -36,7 +36,6 @@ #include "huge.h" #include "timer.h" -#include "crc32.h" #include "database.h" #include "hs_compile.h" #include "hs_internal.h" @@ -46,12 +45,15 @@ #include #include +#include #include #include #include #include #include +#include + using namespace std; EngineContext::EngineContext(const hs_database_t *db) { @@ -230,11 +232,13 @@ string dbSettingsHash(const string &filename, u32 mode) { string info = info_oss.str(); - u32 crc = Crc32c_ComputeBuf(0, info.data(), info.size()); + boost::crc_32_type crc; + + crc.process_bytes(info.data(), info.length()); // return STL string with printable version of digest ostringstream oss; - oss << hex << setw(8) << setfill('0') << crc << dec; + oss << hex << setw(8) << setfill('0') << crc.checksum() << dec; return oss.str(); }