CMS 3D CMS Logo

cms::CRC32Calculator Class Reference

#include <FWCore/Utilities/interface/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_, 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   }


Member Function Documentation

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_; }


Member Data Documentation

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

Definition at line 72 of file CRC32Calculator.h.

Referenced by checksum(), and CRC32Calculator().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:31 2009 for CMSSW by  doxygen 1.5.4