Skip to content

Instantly share code, notes, and snippets.

@ArtemGr
Created May 29, 2011 15:58
Show Gist options
  • Select an option

  • Save ArtemGr/997887 to your computer and use it in GitHub Desktop.

Select an option

Save ArtemGr/997887 to your computer and use it in GitHub Desktop.
crc64 with Boost
// aptitude install libboost-dev
// http://www.boost.org/doc/libs/1_52_0/libs/crc/crc.html
#include <boost/crc.hpp>
static uint64_t crc64 (const string& str) {
boost::crc_optimal<64, 0x04C11DB7, 0, 0, false, false> crc;
crc.process_bytes (str.data(), str.size());
return crc.checksum();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment