absl::MemcpyCrc32c

Copy bytes while computing the CRC32C value of the copied data.

Synopsis

Declared in <absl/crc/crc32c.h>

crc32c_t
MemcpyCrc32c(
    void* dest,
    void const* src,
    size_t count,
    crc32c_t initial_crc = crc32c_t{0});

Description

Copies src to dest using memcpy() semantics, returning the CRC32C value of the copied buffer.

Using MemcpyCrc32c() is potentially faster than performing the memcpy() and ComputeCrc32c() operations separately.

Return Value

The CRC32C value of the copied bytes.

Parameters

NameDescription
destThe destination buffer.
srcThe source buffer.
countThe number of bytes to copy.
initial_crcThe CRC32C value to extend.