test
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

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

Private Attributes

std::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 AlCaHLTBitMon_ParallelJobs::p.

81  {
82 
83  /* initialize value */
84  checksum_ = CRC32_XINIT;
85 
86  /* process each byte prior to checksum field */
87  auto length = message.length();
88  char const* p = message.data();
89  for (size_t 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  }
int j
Definition: DBlmapReader.cc:9
std::uint32_t checksum_

Member Function Documentation

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

Member Data Documentation

std::uint32_t cms::CRC32Calculator::checksum_
private

Definition at line 72 of file CRC32Calculator.h.

Referenced by checksum(), and CRC32Calculator().