Yate
Public Member Functions | Static Public Member Functions

MD5 Class Reference

A standard MD5 digest calculator. More...

#include <yateclass.h>

List of all members.

Public Member Functions

 MD5 ()
 MD5 (const MD5 &original)
 MD5 (const void *buf, unsigned int len)
 MD5 (const DataBlock &data)
 MD5 (const String &str)
 ~MD5 ()
MD5operator= (const MD5 &original)
void clear ()
void finalize ()
bool update (const void *buf, unsigned int len)
bool update (const DataBlock &data)
bool update (const String &str)
MD5operator<< (const String &value)
MD5operator<< (const DataBlock &data)
MD5operator<< (const char *value)
const unsigned char * rawDigest ()
const StringhexDigest ()

Static Public Member Functions

static unsigned int rawLength ()

Detailed Description

A standard MD5 digest calculator.

A class to compute and check MD5 digests


Constructor & Destructor Documentation

MD5 ( )

Construct a fresh initialized instance

MD5 ( const MD5 original)

Copy constructor

Parameters:
originalMD5 instance to copy
MD5 ( const void *  buf,
unsigned int  len 
)

Construct a digest from a buffer of data

Parameters:
bufPointer to the data to be included in digest
lenLength of data in the buffer
MD5 ( const DataBlock data)

Construct a digest from a binary DataBlock

Parameters:
dataBinary data to be included in digest
MD5 ( const String str)

Construct a digest from a String

Parameters:
strString to be included in digest
~MD5 ( )

Destroy the instance, free allocated memory


Member Function Documentation

void clear ( )

Clear the digest and prepare for reuse

void finalize ( )

Finalize the digest computation, make result ready. Subsequent calls to update() will fail

const String& hexDigest ( )

Returns the standard hexadecimal representation of the message digest. The digest is finalized if if wasn't already

Returns:
A String which holds the hex digest or a null one if some error occured
MD5& operator<< ( const DataBlock data) [inline]

MD5 updating operator for DataBlocks

MD5& operator<< ( const char *  value)

MD5 updating operator for C strings

MD5& operator<< ( const String value) [inline]

MD5 updating operator for Strings

MD5& operator= ( const MD5 original)

Assignment operator.

const unsigned char* rawDigest ( )

Returns a pointer to the raw 16-byte binary value of the message digest. The digest is finalized if if wasn't already

Returns:
Pointer to the raw digest data or NULL if some error occured
static unsigned int rawLength ( ) [inline, static]

Return the length of the raw binary digest

Returns:
Constant value of 16
bool update ( const DataBlock data) [inline]

Update the digest from the content of a DataBlock

Parameters:
dataData to be included in digest
Returns:
True if success, false if finalize() was already called

References DataBlock::data(), DataBlock::length(), and MD5::update().

Referenced by MD5::update().

bool update ( const void *  buf,
unsigned int  len 
)

Update the digest from a buffer of data

Parameters:
bufPointer to the data to be included in digest
lenLength of data in the buffer
Returns:
True if success, false if finalize() was already called
bool update ( const String str) [inline]

Update the digest from the content of a String

Parameters:
strString to be included in digest
Returns:
True if success, false if finalize() was already called

References String::c_str(), String::length(), and MD5::update().

Referenced by MD5::update().


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