folly::crc32_type

Compute the CRC-32 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
crc32_type(
    uint8_t const* data,
    size_t nbytes,
    uint32_t startingChecksum = ~0U);

Description

NOTE

compared to crc32(), crc32_type() uses a different set of default parameters to match the results returned by boost::crc_32_type and php's built-in crc32 implementation

Return Value

The CRC-32 checksum of the buffer

Parameters

NameDescription
dataPointer to the buffer to checksum
nbytesNumber of bytes in the buffer
startingChecksumInitial checksum value to continue from