Logo Search packages:      
Sourcecode: ccbuild version File versions

bneijt::MD5Hash Class Reference

#include <MD5Hash.hh>

List of all members.

Detailed Description

Simple one-run MD5 hashing class.

Definition at line 32 of file MD5Hash.hh.

Public Member Functions

void clear ()
 Clears the hash to an empty value.
void from (std::string const &filename)
 Load the hash by MD5 hashing the file behind the given filename.
void fromHex (std::string const &word)
 Load the hash from the first 32 hex characters of the given string.
unsigned char const * hash () const
 Return a const pointer to the 16 bytes of hash data in memory.
bool isLoaded () const
 Returns wether this hash has ever been set to a value.
 MD5Hash (std::string const &word)
 Initialize using the hash of the given string (calles from(word)).
 MD5Hash ()
bool const operator!= (MD5Hash const &rvalue) const
 Inverted version of the equallity check.
double const operator- (MD5Hash const &rvalue) const
 Calculate the difference.
bool operator< (MD5Hash const &rvalue) const
 Returns wether the given hash is smaller then this hash..
bool const operator== (MD5Hash const &rvalue) const
 Equallity check.
unsigned char const & operator[] (unsigned i) const
 Return the ith hash byte.
void random ()
 Fills the hash with random values.
unsigned const size () const
 Returns the size of the hash in bytes (16).

Static Private Member Functions

static unsigned char hex (char c)
 Return the hex value of a given character.

Private Attributes

unsigned char d_hash [d_size]
 The hash in bytes.
bool d_loaded
 Wether the hash was loaded.

Static Private Attributes

static unsigned const d_size = 16
 The size, in bytes, of the hash.

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

Generated by  Doxygen 1.6.0   Back to index