MD5 Class Reference

#include <mimotera++/MD5.hh>

List of all members.

Public Types

typedef unsigned int size_type

Public Member Functions

 MD5 ()
 MD5 (const std::string &text)
void update (const unsigned char *buf, size_type length)
void update (const char *buf, size_type length)
MD5finalize ()
std::string hexdigest () const
void print (std::ostream &os) const


Detailed Description

MD5 class

This class is computing the MD5 hash (or finger print) of a file or a block of bytes. It is not meant to be either fast or secure, but it is reliable enough to be used as a debug tool in understanding if two files are the same or not.

This code is derived from the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" and this is the license to copy and use coming with this code.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function.

License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work.

RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this documentation and/or software.

The use is very simple and self examplaining.

Definition at line 76 of file MD5.hh.


Member Typedef Documentation

typedef unsigned int MD5::size_type

Definition at line 79 of file MD5.hh.


Constructor & Destructor Documentation

MD5::MD5 (  ) 

Default constructor

Definition at line 103 of file MD5.cc.

MD5::MD5 ( const std::string &  text  ) 

Default constructor with a string of text in input

Parameters:
text The text for MD5 calculation

Definition at line 110 of file MD5.cc.

References finalize(), and update().

Here is the call graph for this function:


Member Function Documentation

MD5 & MD5::finalize (  ) 

Finish the data input

Definition at line 290 of file MD5.cc.

References update().

Referenced by MD5().

Here is the call graph for this function:

std::string MD5::hexdigest (  )  const

Get the hex fingerprint

Returns:
the hexadecimal finger print

Definition at line 326 of file MD5.cc.

Referenced by md5(), and print().

void MD5::print ( std::ostream &  os  )  const

Print

Parameters:
os The output streamer

Definition at line 341 of file MD5.cc.

References hexdigest().

Referenced by operator<<().

Here is the call graph for this function:

void MD5::update ( const char *  buf,
size_type  length 
)

Update method

Parameters:
buf An array of signed char
length Length of the buffer

void MD5::update ( const unsigned char *  buf,
size_type  length 
)

Update method

Parameters:
buf An array of unsigned char
length Length of the buffer

Referenced by finalize(), and MD5().


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

Generated on Fri Sep 18 19:15:34 2009 for Mimotera++ by  doxygen 1.5.7.1