#include <FWCore/Utilities/interface/CRC32Calculator.h>
Public Member Functions | |
boost::uint32_t | checksum () |
CRC32Calculator (std::string const &message) | |
Private Attributes | |
boost::uint32_t | checksum_ |
Definition at line 62 of file CRC32Calculator.h.
cms::CRC32Calculator::CRC32Calculator | ( | std::string const & | message | ) |
Definition at line 81 of file CRC32Calculator.cc.
References checksum_, cms::CRC32_XINIT, cms::CRC32_XOROT, cms::crctable, j, and p.
00081 { 00082 00083 /* initialize value */ 00084 checksum_ = CRC32_XINIT; 00085 00086 /* process each byte prior to checksum field */ 00087 int length = message.length(); 00088 char const* p = message.data(); 00089 for (int j = 0; j < length; j++) { 00090 unsigned char uc = *p++; 00091 checksum_ = cms::crctable[(checksum_ ^ uc) & 0xFFL] ^ (checksum_ >> 8); 00092 } 00093 00094 /* return XOR out value */ 00095 checksum_ = checksum_ ^ CRC32_XOROT; 00096 }
boost::uint32_t cms::CRC32Calculator::checksum | ( | ) | [inline] |
Definition at line 68 of file CRC32Calculator.h.
References checksum_.
Referenced by edm::BranchID::setID().
00068 { return checksum_; }
boost::uint32_t cms::CRC32Calculator::checksum_ [private] |