List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
utl::Md5Sum Class Reference

Class to compute MD5 checksum Based on the RSA C code, wrapped in an OO fashion. More...

#include "utl/Md5Sum.h"

Classes

class  WrongStageException
 

Public Types

typedef const unsigned char * Iterator
 
typedef std::pair< Iterator,
Iterator
IteratorPair
 

Public Member Functions

void AddData (const std::string &s)
 Process the data in a string. More...
 
void AddData (const char *const s)
 
void AddDataRange (const unsigned char *const begin, const unsigned char *const end)
 
void AddDataRange (const char *const begin, const char *const end)
 
void Clear ()
 Set up internal state. More...
 
std::string GetHexDigest ()
 
IteratorPair GetRawDigest ()
 
bool IsFinalized () const
 
 Md5Sum ()
 
 Md5Sum (const std::string &data)
 

Static Public Attributes

static const unsigned int kBufferSize = 64
 
static const unsigned int kDigestSize = 16
 

Private Member Functions

unsigned int BufferIndex () const
 
void ProcessBuffer ()
 

Private Attributes

unsigned char fBuffer [kBufferSize]
 input buffer More...
 
unsigned int fCountHigh
 
unsigned int fCountLow
 Number of bits, mod 2^64 (lsb first) More...
 
unsigned char fDigest [kDigestSize]
 buffer for final digest More...
 
bool fFinalized
 
unsigned int fStateA
 internal state (A), 4 of 16 bytes, 64 bit total More...
 
unsigned int fStateB
 internal state (B), 4 of 16 bytes, 64 bit total More...
 
unsigned int fStateC
 internal state (C), 4 of 16 bytes, 64 bit total More...
 
unsigned int fStateD
 internal state (D), 4 of 16 bytes, 64 bit total More...
 

Detailed Description

Class to compute MD5 checksum Based on the RSA C code, wrapped in an OO fashion.

Note
See MD5 wiki for the reference
Author
Lukas Nellen
Date
03 Dec 2008
20 Aug 2009 DV

Definition at line 27 of file Md5Sum.h.

Member Typedef Documentation

typedef const unsigned char* utl::Md5Sum::Iterator

Definition at line 29 of file Md5Sum.h.

Definition at line 30 of file Md5Sum.h.

Constructor & Destructor Documentation

utl::Md5Sum::Md5Sum ( )
inline

Definition at line 45 of file Md5Sum.h.

References Clear().

utl::Md5Sum::Md5Sum ( const std::string &  data)
inline

Definition at line 47 of file Md5Sum.h.

References AddData(), and Clear().

Member Function Documentation

void utl::Md5Sum::AddData ( const std::string &  s)
inline

Process the data in a string.

Definition at line 56 of file Md5Sum.h.

References AddDataRange(), and G4StationSimulatorOG::p.

Referenced by Md5Sum(), and testMd5Sum::testUseFinalized().

void utl::Md5Sum::AddData ( const char *const  s)
inline

Definition at line 63 of file Md5Sum.h.

References AddDataRange(), and G4StationSimulatorOG::p.

void utl::Md5Sum::AddDataRange ( const unsigned char *const  begin,
const unsigned char *const  end 
)

Definition at line 180 of file Md5Sum.cc.

References G4StationSimulatorOG::p.

Referenced by AddData(), and AddDataRange().

void utl::Md5Sum::AddDataRange ( const char *const  begin,
const char *const  end 
)
inline

Definition at line 51 of file Md5Sum.h.

References AddDataRange().

unsigned int utl::Md5Sum::BufferIndex ( ) const
inlineprivate

Definition at line 83 of file Md5Sum.h.

References fCountLow, and kBufferSize.

void utl::Md5Sum::Clear ( )

Set up internal state.

Definition at line 164 of file Md5Sum.cc.

Referenced by Md5Sum().

string utl::Md5Sum::GetHexDigest ( )

Definition at line 340 of file Md5Sum.cc.

Referenced by fevt::TelescopeSimData::GetConfigSignature(), and testMd5Sum::MD5().

Md5Sum::IteratorPair utl::Md5Sum::GetRawDigest ( )

Definition at line 309 of file Md5Sum.cc.

Referenced by testMd5Sum::testUseFinalized().

bool utl::Md5Sum::IsFinalized ( ) const
inline

Definition at line 74 of file Md5Sum.h.

References fFinalized.

void utl::Md5Sum::ProcessBuffer ( )
private

Definition at line 211 of file Md5Sum.cc.

References RdGeoCeLDFFitter::a, RdGeoCeLDFFitter::b, and RdGeoCeLDFFitter::c.

Member Data Documentation

unsigned char utl::Md5Sum::fBuffer[kBufferSize]
private

input buffer

Definition at line 100 of file Md5Sum.h.

unsigned int utl::Md5Sum::fCountHigh
private

Definition at line 98 of file Md5Sum.h.

unsigned int utl::Md5Sum::fCountLow
private

Number of bits, mod 2^64 (lsb first)

Definition at line 97 of file Md5Sum.h.

Referenced by BufferIndex().

unsigned char utl::Md5Sum::fDigest[kDigestSize]
private

buffer for final digest

Definition at line 102 of file Md5Sum.h.

bool utl::Md5Sum::fFinalized
private

Definition at line 86 of file Md5Sum.h.

Referenced by IsFinalized().

unsigned int utl::Md5Sum::fStateA
private

internal state (A), 4 of 16 bytes, 64 bit total

Definition at line 89 of file Md5Sum.h.

unsigned int utl::Md5Sum::fStateB
private

internal state (B), 4 of 16 bytes, 64 bit total

Definition at line 91 of file Md5Sum.h.

unsigned int utl::Md5Sum::fStateC
private

internal state (C), 4 of 16 bytes, 64 bit total

Definition at line 93 of file Md5Sum.h.

unsigned int utl::Md5Sum::fStateD
private

internal state (D), 4 of 16 bytes, 64 bit total

Definition at line 95 of file Md5Sum.h.

const unsigned int utl::Md5Sum::kBufferSize = 64
static

Definition at line 31 of file Md5Sum.h.

Referenced by BufferIndex().

const unsigned int utl::Md5Sum::kDigestSize = 16
static

Definition at line 32 of file Md5Sum.h.


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

, generated on Tue Sep 26 2023.