1 //===-- llvm/Support/JamCRC.h - Cyclic Redundancy Check ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains an implementation of JamCRC.
12 // We will use the "Rocksoft^tm Model CRC Algorithm" to describe the properties
20 // Check : 340BC6D9 (result of CRC for "123456789")
22 // N.B. We permit flexibility of the "Init" value. Some consumers of this need
25 //===----------------------------------------------------------------------===//
27 #ifndef LLVM_SUPPORT_JAMCRC_H
28 #define LLVM_SUPPORT_JAMCRC_H
30 #include "llvm/ADT/ArrayRef.h"
31 #include "llvm/Support/DataTypes.h"
36 JamCRC(uint32_t Init = 0xFFFFFFFFU) : CRC(Init) {}
38 // \brief Update the CRC calculation with Data.
39 void update(ArrayRef<char> Data);
41 uint32_t getCRC() const { return CRC; }
46 } // End of namespace llvm