= ALCF's High-Performance CRC64 Library = == Description == This library implements a high-performance computation of the 64-bit cyclic-redundancy check (CRC) of arbitrary input data. This implementation requires only a C99 compiler, but has been tuned for the IBM BG/Q supercomputer, and can take advantage of a compiler's OpenMP support to compute the CRC in parallel on multiple cores. Computing and storing or transmitting the CRC code of data while it is written to disk or transmitted over the network, and then using it to verify the integrity of the data upon read-in or receipt, is a powerful way to guard against data corruption. While modern disks and networks are highly reliable, the rate of corruption from malfunctioning software, hardware and external physical processes remains significant (especially for large data sets). This implementation uses the ECMA-182 polynomial with -1 initialization, and computes the bit-reversed CRC. == Code == You can obtain the latest version of the source code directly from the public git repository: {{{ git clone http://git.mcs.anl.gov/hpcrc64.git }}} == Interface == This library provides the following functions for general-purpose use. For most applications, only crc64_omp (and possibly crc64_invert) will be of use: Calculate the CRC64 of the provided buffer (in serial). {{{ uint64_t crc64(const void *input, size_t nbytes); }}} Calculate the CRC64 of the provided buffer, in parallel if possible (using OpenMP). {{{ uint64_t crc64_omp(const void *input, size_t nbytes); }}} Calculate the 'check bytes' for the provided CRC64. If these bytes are appended to the original buffer, then the new total CRC64 should be -1. The CRC64 of the buffer is provided as is a pointer to the end of the buffer (where the inverted CRC will be written). The end-of-buffer pointer need not be aligned. {{{ void crc64_invert(uint64_t cs, void *buffer); }}} Given the CRC64 of the first part of a buffer, and the CRC64 and length of the second part of a buffer, calculate the CRC64 of the complete buffer. {{{ uint64_t crc64_combine(uint64_t cs1, uint64_t cs2, size_t nbytes2); }}} == References == Useful references on CRCs: * [http://en.wikipedia.org/wiki/Computation_of_CRC] * [http://checksumcrc.blogspot.com/2011/12/should-you-use-crc-or-checksum.html] * [http://crcutil.googlecode.com/files/crc-doc.1.0.pdf] * [http://www.ross.net/crc/download/crc_v3.txt]