crc32.h 735 B

123456789101112131415161718192021222324
  1. // Copyright 2019 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.
  4. #ifndef BASE_METRICS_CRC32_H_
  5. #define BASE_METRICS_CRC32_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include "base/base_export.h"
  9. namespace base {
  10. BASE_EXPORT extern const uint32_t kCrcTable[256];
  11. // This provides a simple, fast CRC-32 calculation that can be used for checking
  12. // the integrity of data. It is not a "secure" calculation! |sum| can start
  13. // with any seed or be used to continue an operation began with previous data.
  14. BASE_EXPORT uint32_t Crc32(uint32_t sum, const void* data, size_t size);
  15. } // namespace base
  16. #endif // BASE_METRICS_CRC32_H_