]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
hsbench: use boost:crc for db filename
authorMatthew Barr <matthew.barr@intel.com>
Thu, 4 May 2017 00:37:45 +0000 (10:37 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 30 May 2017 03:59:00 +0000 (13:59 +1000)
tools/hsbench/engine_hyperscan.cpp

index eadc1cc4c75aadb07dee0db27235a4a1cba807f7..9674e5c8493100c5e410c7390b2f2494482af89b 100644 (file)
@@ -36,7 +36,6 @@
 #include "huge.h"
 #include "timer.h"
 
-#include "crc32.h"
 #include "database.h"
 #include "hs_compile.h"
 #include "hs_internal.h"
 
 #include <cassert>
 #include <cstring>
+#include <functional>
 #include <iomanip>
 #include <sstream>
 #include <string>
 #include <utility>
 #include <vector>
 
+#include <boost/crc.hpp>
+
 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();
 }