CMS 3D CMS Logo

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_, 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  }
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().