proxygen
Checksum.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-present Facebook, Inc.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #pragma once
18 
19 #include <stdint.h>
20 #include <cstddef>
21 
22 /*
23  * Checksum functions
24  */
25 
26 namespace folly {
27 
38 crc32c(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);
39 
46 crc32(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);
47 
58 crc32_type(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);
59 
87 uint32_t crc32_combine(uint32_t crc1, uint32_t crc2, size_t crc2len);
88 
89 /* crc32c_combine is the same as crc32_combine, but uses the crc32c
90  polynomial */
91 uint32_t crc32c_combine(uint32_t crc1, uint32_t crc2, size_t crc2len);
92 
93 } // namespace folly
uint32_t crc32_type(const uint8_t *data, size_t nbytes, uint32_t startingChecksum)
Definition: Checksum.cpp:145
uint32_t crc32c(const uint8_t *data, size_t nbytes, uint32_t startingChecksum)
Definition: Checksum.cpp:128
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
uint32_t crc32(const uint8_t *data, size_t nbytes, uint32_t startingChecksum)
Definition: Checksum.cpp:136
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
uint32_t crc32c_combine(uint32_t crc1, uint32_t crc2, size_t crc2len)
Definition: Checksum.cpp:164
uint32_t crc32_combine(uint32_t crc1, uint32_t crc2, size_t crc2len)
Definition: Checksum.cpp:149