Public Member Functions | Private Attributes | List of all members
cet::CRC32Calculator Class Reference

#include <CRC32Calculator.h>

Public Member Functions

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

Private Attributes

std::uint32_t checksum_
 

Detailed Description

Definition at line 62 of file CRC32Calculator.h.

Constructor & Destructor Documentation

cet::CRC32Calculator::CRC32Calculator ( std::string const &  message)
explicit

Definition at line 66 of file CRC32Calculator.cc.

67  {
68 
69  /* initialize value */
70  checksum_ = CRC32_XINIT;
71 
72  /* process each byte prior to checksum field */
73  int length = message.length();
74  char const* p = message.data();
75  for (int j = 0; j < length; j++) {
76  unsigned char uc = *p++;
77  checksum_ = crctable[(checksum_ ^ uc) & 0xFFL] ^ (checksum_ >> 8);
78  }
79 
80  /* return XOR out value */
81  checksum_ = checksum_ ^ CRC32_XOROT;
82  }
p
Definition: test.py:223
std::uint32_t checksum_

Member Function Documentation

std::uint32_t cet::CRC32Calculator::checksum ( ) const
inline

Definition at line 66 of file CRC32Calculator.h.

67  {
68  return checksum_;
69  }
std::uint32_t checksum_

Member Data Documentation

std::uint32_t cet::CRC32Calculator::checksum_
private

Definition at line 72 of file CRC32Calculator.h.


The documentation for this class was generated from the following files: