CMS 3D CMS Logo

Public Member Functions | Private Attributes

cms::CRC32Calculator Class Reference

#include <CRC32Calculator.h>

List of all members.

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.

                                                           {

    /* initialize value */
    checksum_ = CRC32_XINIT;

    /* process each byte prior to checksum field */
    int length = message.length();
    char const* p = message.data();
    for (int j = 0; j < length; j++) {
      unsigned char uc = *p++;
      checksum_ = cms::crctable[(checksum_ ^ uc) & 0xFFL] ^ (checksum_ >> 8);
    }

    /* return XOR out value */
    checksum_ = checksum_ ^ CRC32_XOROT;
  }

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().

{ return checksum_; }

Member Data Documentation

boost::uint32_t cms::CRC32Calculator::checksum_ [private]

Definition at line 72 of file CRC32Calculator.h.

Referenced by checksum(), and CRC32Calculator().