Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
cet::crc32 Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/crc32.h"

Public Types

using uchar = unsigned char
 
using digest_t = std::uint32_t
 

Public Member Functions

constexpr crc32 ()=default
 
constexpr crc32 (char const *mesg)
 
constexpr crc32 (char const mesg)
 
 crc32 (std::string const &mesg)
 
constexpr crc32operator<< (char const *mesg)
 
constexpr crc32operator<< (char const mesg)
 
crc32operator<< (std::string const &mesg)
 
constexpr digest_t digest () const
 

Static Private Member Functions

static constexpr std::uint32_t crc32_xorot ()
 

Private Attributes

digest_t context {0xFFFFFFFFL}
 

Static Private Attributes

static constexpr std::uint32_t crctable [256]
 

Detailed Description

Definition at line 19 of file crc32.h.

Member Typedef Documentation

using cet::crc32::digest_t = std::uint32_t

Definition at line 22 of file crc32.h.

using cet::crc32::uchar = unsigned char

Definition at line 21 of file crc32.h.

Constructor & Destructor Documentation

constexpr cet::crc32::crc32 ( )
default
constexpr cet::crc32::crc32 ( char const *  mesg)
explicit

Definition at line 107 of file crc32.h.

References operator<<().

108 {
109  operator<<(mesg);
110 }
constexpr crc32 & operator<<(char const *mesg)
Definition: crc32.h:119
constexpr cet::crc32::crc32 ( char const  mesg)
explicit

Definition at line 112 of file crc32.h.

References operator<<().

113 {
114  operator<<(mesg);
115 }
constexpr crc32 & operator<<(char const *mesg)
Definition: crc32.h:119
cet::crc32::crc32 ( std::string const &  mesg)
explicit

Member Function Documentation

static constexpr std::uint32_t cet::crc32::crc32_xorot ( )
inlinestaticprivate

Definition at line 43 of file crc32.h.

References CLHEP::L.

Referenced by digest().

44  {
45  return 0xFFFFFFFFL;
46  }
static constexpr double L
constexpr cet::crc32::digest_t cet::crc32::digest ( ) const

Definition at line 138 of file crc32.h.

References crc32_xorot().

139 {
140  return context ^ crc32_xorot();
141 }
static constexpr std::uint32_t crc32_xorot()
Definition: crc32.h:43
const XML_Char * context
Definition: expat.h:434
constexpr cet::crc32 & cet::crc32::operator<< ( char const *  mesg)

Definition at line 119 of file crc32.h.

References MECModelEnuComparisons::i.

Referenced by crc32().

120 {
121  unsigned i{};
122  while (mesg[i] != '\0') {
123  operator<<(mesg[i]);
124  ++i;
125  }
126  return *this;
127 }
constexpr crc32 & operator<<(char const *mesg)
Definition: crc32.h:119
constexpr cet::crc32 & cet::crc32::operator<< ( char const  mesg)

Definition at line 130 of file crc32.h.

References crctable.

131 {
132  uchar const ch = mesg;
133  context = crctable[(context ^ ch) & 0xFFL] ^ (context >> 8);
134  return *this;
135 }
static constexpr std::uint32_t crctable[256]
Definition: crc32.h:47
unsigned char uchar
Definition: crc32.h:21
const XML_Char * context
Definition: expat.h:434
crc32& cet::crc32::operator<< ( std::string const &  mesg)

Member Data Documentation

digest_t cet::crc32::context {0xFFFFFFFFL}
private

Definition at line 39 of file crc32.h.

constexpr std::uint32_t cet::crc32::crctable[256]
staticprivate

Definition at line 47 of file crc32.h.

Referenced by operator<<().


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