The test fails due to a console messages arriving sometimes before the console evalua...
[chromium-blink-merge.git] / courgette / crc.cc
blob02b7fe9386fa49f69188d60683d0fae43d2788e2
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Calculate Crc by calling CRC method in LZMA SDK
7 #include "courgette/crc.h"
9 extern "C" {
10 #include "third_party/lzma_sdk/7zCrc.h"
13 namespace courgette {
15 uint32 CalculateCrc(const uint8* buffer, size_t size) {
16 CrcGenerateTable();
17 uint32 crc = 0xffffffffL;
18 crc = ~CrcCalc(buffer, size);
19 return crc;
22 } // namespace