2 * Copyright 2017 Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
29 * Compute the CRC-32C checksum of a buffer, using a hardware-accelerated
30 * implementation if available or a portable software implementation as
33 * @note CRC-32C is different from CRC-32; CRC-32C starts with a different
34 * polynomial and thus yields different results for the same input
35 * than a traditional CRC-32.
37 uint32_t crc32c(const uint8_t* data, size_t nbytes,
38 uint32_t startingChecksum = ~0U);
41 * Compute the CRC-32 checksum of a buffer, using a hardware-accelerated
42 * implementation if available or a portable software implementation as
46 crc32(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);
49 * Compute the CRC-32 checksum of a buffer, using a hardware-accelerated
50 * implementation if available or a portable software implementation as
53 * @note compared to crc32(), crc32_type() uses a different set of default
54 * parameters to match the results returned by boost::crc_32_type and
55 * php's built-in crc32 implementation
58 crc32_type(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);