Skip to content

Commit

Permalink
Revert 112083 - Try a different library for Crc32.
Browse files Browse the repository at this point in the history
BUG=
TEST=


Review URL: http://codereview.chromium.org/8569018

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/8742002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112104 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
cbentzel@chromium.org committed Nov 30, 2011
1 parent 5028de3 commit 4ae5894
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions courgette/crc.cc
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Calculate Crc by calling CRC method in LZMA SDK

#include "courgette/crc.h"

#ifdef OS_CHROMEOS
# include "zlib.h"
#else
extern "C" {
# include "third_party/lzma_sdk/7zCrc.h"
#include "third_party/lzma_sdk/7zCrc.h"
}
#endif

#include "base/basictypes.h"

namespace courgette {

uint32 CalculateCrc(const uint8* buffer, size_t size) {
uint32 crc;

#ifdef OS_CHROMEOS
// Calculate Crc by calling CRC method in zlib
crc = crc32(0, buffer, size);
#else
// Calculate Crc by calling CRC method in LZMA SDK
CrcGenerateTable();
crc = CrcCalc(buffer, size);
#endif

return ~crc;
uint32 crc = 0xffffffffL;
crc = ~CrcCalc(buffer, size);
return crc;
}

} // namespace

0 comments on commit 4ae5894

Please sign in to comment.