Compute the CRC‐32C checksum of a buffer, using a hardware‐accelerated implementation if available or a portable software implementation as a default.

Synopsis

Declared in <folly/hash/Checksum.h>

uint32_t
crc32c(
    uint8_t const* data,
    size_t nbytes,
    uint32_t startingChecksum = ~0U);

Description

Note

CRC‐32C is different from CRC‐32; CRC‐32C starts with a different polynomial and thus yields different results for the same input than a traditional CRC‐32.

Return Value

The CRC‐32C checksum of the buffer

Parameters

Name

Description

data

Pointer to the buffer to checksum

nbytes

Number of bytes in the buffer

startingChecksum

Initial checksum value to continue from

Created with MrDocs