New file format authors should consider
HighwayHash. The initial version of
this code was extracted from LevelDB, which
is a stable key-value store that is widely used at Google.
This project collects a few CRC32C implementations under an umbrella that
dispatches to a suitable implementation based on the host computer’s hardware
capabilities.
CRC32C is specified as the CRC that uses the iSCSI polynomial in
RFC 3720. The polynomial was
introduced by G. Castagnoli, S. Braeuer and M. Herrmann. CRC32C is used in
software such as Btrfs, ext4, Ceph and leveldb.
Usage
#include "crc32c/crc32c.h"
int main() {
const std::uint8_t buffer[] = {0, 0, 0, 0};
std::uint32_t result;
// Process a raw buffer.
result = crc32c::Crc32c(buffer, 4);
// Process a std::string.
std::string string;
string.resize(4);
result = crc32c::Crc32c(string);
// If you have C++17 support, process a std::string_view.
std::string_view string_view(string);
result = crc32c::Crc32c(string_view);
return 0;
}
Prerequisites
This project uses CMake for building and testing. CMake is
available in all popular Linux distributions, as well as in
Homebrew.
This project uses submodules for dependency management.
git submodule update --init --recursive
If you’re using Atom, the following packages can help.
If you don’t mind more setup in return for more speed, replace
autocomplete-clang and linter-clang with you-complete-me. This requires
setting up ycmd.
CRC32C
New file format authors should consider HighwayHash. The initial version of this code was extracted from LevelDB, which is a stable key-value store that is widely used at Google.
This project collects a few CRC32C implementations under an umbrella that dispatches to a suitable implementation based on the host computer’s hardware capabilities.
CRC32C is specified as the CRC that uses the iSCSI polynomial in RFC 3720. The polynomial was introduced by G. Castagnoli, S. Braeuer and M. Herrmann. CRC32C is used in software such as Btrfs, ext4, Ceph and leveldb.
Usage
Prerequisites
This project uses CMake for building and testing. CMake is available in all popular Linux distributions, as well as in Homebrew.
This project uses submodules for dependency management.
If you’re using Atom, the following packages can help.
If you don’t mind more setup in return for more speed, replace
autocomplete-clangandlinter-clangwithyou-complete-me. This requires setting up ycmd.Building
The following commands build and install the project.
Development
The following command (when executed from
build/) (re)builds the project and runs the tests.Android testing
The following command builds the project against the Android NDK, which is useful for benchmarking against ARM processors.
The following commands install and run the benchmarks.
The following commands install and run the tests.