# class MD5 | A standard MD5 digest calculator. More...
Full name | `TelEngine::MD5`
Definition | `#include <yateclass.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

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

#### Public Static Methods

- static inline unsigned int rawLength ()

## Detailed Description

A class to compute and check MD5 digests

MD5 () | ### MD5

Construct a fresh initialized instance

MD5 (const MD5& original) | ### MD5

Copy constructor

Parameters:

original | MD5 instance to copy

MD5 (const void* buf, unsigned int len) | ### MD5

Construct a digest from a buffer of data

Parameters:

buf | Pointer to the data to be included in digest
len | Length of data in the buffer

MD5 (const DataBlock& data) | ### MD5

Construct a digest from a binary DataBlock

Parameters:

data | Binary data to be included in digest

MD5 (const String& str) | ### MD5

Construct a digest from a String

Parameters:

str | String to be included in digest

~MD5 () | ### ~MD5

Destroy the instance, free allocated memory

MD5& operator= (const MD5& original) | ### operator=

Assignment operator.

void clear () | ### clear

Clear the digest and prepare for reuse

void finalize () | ### finalize

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

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

Update the digest from a buffer of data

Parameters:

buf | Pointer to the data to be included in digest
len | Length of data in the buffer

Returns: True if success, false if finalize() was already called

inline bool update (const DataBlock& data) | ### update

Update the digest from the content of a DataBlock

Parameters:

data | Data to be included in digest

Returns: True if success, false if finalize() was already called

inline bool update (const String& str) | ### update

Update the digest from the content of a String

Parameters:

str | String to be included in digest

Returns: True if success, false if finalize() was already called

inline MD5& operator<< (const String& value) | ### operator<<

MD5 updating operator for Strings

inline MD5& operator<< (const DataBlock& data) | ### operator<<

MD5 updating operator for DataBlocks

MD5& operator<< (const char* value) | ### operator<<

MD5 updating operator for C strings

const unsigned char* rawDigest () | ### 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

inline unsigned int rawLength () | ### rawLength

[static]

Return the length of the raw binary digest

Returns: Constant value of 16

const String& hexDigest () | ### 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

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.