1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "courgette/crc.h"
10 #ifdef COURGETTE_USE_CRC_LIB
14 #include "third_party/lzma_sdk/C/7zCrc.h"
21 uint32_t CalculateCrc(const uint8_t* buffer, size_t size) {
24 #ifdef COURGETTE_USE_CRC_LIB
25 // Calculate Crc by calling CRC method in zlib
26 crc = crc32(0, buffer, size);
28 // Calculate Crc by calling CRC method in LZMA SDK
30 crc = CrcCalc(buffer, size);