Compute the CRC32C value of a buffer with a prefix removed.

Synopsis

Declared in <absl/crc/crc32c.h>

crc32c_t
RemoveCrc32cPrefix(
    crc32c_t prefix_crc,
    crc32c_t full_string_crc,
    size_t remaining_string_length);

Description

Calculates the CRC32C value of an existing buffer with a series of bytes (the prefix) removed from the beginning of that buffer.

Given the CRC32C value of an existing buffer, full_string_crc; The CRC32C value of a prefix of that buffer, prefix_crc; and the length of the buffer with the prefix removed, remaining_string_length , return the CRC32C value of the buffer with the prefix removed.

This operation has a runtime cost of O(log(remaining_string_length)).

Return Value

The CRC32C value of the buffer with the prefix removed.

Parameters

Name

Description

prefix_crc

The CRC32C value of the prefix being removed.

full_string_crc

The CRC32C value of the complete buffer.

remaining_string_length

The length of the buffer after removal.

Created with MrDocs