xpcom/io/crc32c.h
author Boris Zbarsky <bzbarsky@mit.edu>
Fri, 09 Feb 2018 11:17:09 -0500
changeset 403182 b01bd36c38995a89fa6a012fa8132eed7e284f72
parent 219555 8628a94a64445c1f66b349a8bbd391596e633adc
child 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1436508 part 10. Remove use of nsIDOMKeyEvent in JS. r=masayuki MozReview-Commit-ID: GGciORX62Yh

#ifndef crc32c_h
#define crc32c_h

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

// Compute a CRC32c as defined in RFC3720.  This is a different polynomial than
// what is used in the crc for zlib, etc.  Typical usage to calculate a new CRC:
//
//    ComputeCrc32c(~0, buffer, bufferLength);
//
uint32_t
ComputeCrc32c(uint32_t aCrc, const void *aBuf, size_t aSize);

#ifdef __cplusplus
} // extern "C"
#endif

#endif // crc32c_h