CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cms::CRC32Calculator Class Reference

#include <CRC32Calculator.h>

Public Member Functions

boost::uint32_t checksum ()
 
 CRC32Calculator (std::string const &message)
 

Private Attributes

boost::uint32_t checksum_
 

Detailed Description

Definition at line 62 of file CRC32Calculator.h.

Constructor & Destructor Documentation

cms::CRC32Calculator::CRC32Calculator ( std::string const &  message)

Definition at line 81 of file CRC32Calculator.cc.

References checksum_, j, and L1TEmulatorMonitor_cff::p.

81  {
82 
83  /* initialize value */
84  checksum_ = CRC32_XINIT;
85 
86  /* process each byte prior to checksum field */
87  int length = message.length();
88  char const* p = message.data();
89  for (int j = 0; j < length; j++) {
90  unsigned char uc = *p++;
91  checksum_ = cms::crctable[(checksum_ ^ uc) & 0xFFL] ^ (checksum_ >> 8);
92  }
93 
94  /* return XOR out value */
95  checksum_ = checksum_ ^ CRC32_XOROT;
96  }
boost::uint32_t checksum_
int j
Definition: DBlmapReader.cc:9
string message
Definition: argparse.py:126

Member Function Documentation

boost::uint32_t cms::CRC32Calculator::checksum ( )
inline

Definition at line 68 of file CRC32Calculator.h.

References checksum_.

Referenced by edm::BranchID::toID().

68 { return checksum_; }
boost::uint32_t checksum_

Member Data Documentation

boost::uint32_t cms::CRC32Calculator::checksum_
private

Definition at line 72 of file CRC32Calculator.h.

Referenced by checksum(), and CRC32Calculator().