#include <MD5.h>
Public Types | |
typedef boost::uint8_t | value_type [16] |
Public Member Functions | |
MD5 () | |
create an (recognizable!) invalid digest... | |
std::string | str () const |
provide a hex string representation of the (internal) 128 bit value of the computed digest | |
bool | invalid () const |
check whether the digest is the (valid) result of an MD5 computation | |
bool | valid () const |
bool | operator< (const MD5 &rhs) const |
binary comparisons | |
bool | operator> (const MD5 &rhs) const |
bool | operator== (const MD5 &rhs) const |
bool | operator<= (const MD5 &rhs) const |
bool | operator>= (const MD5 &rhs) const |
bool | operator!= (const MD5 &rhs) const |
Static Public Member Functions | |
static MD5 | createInvalid () |
static MD5 | compute (const std::string &s) |
compute MD5 digest for the specified string | |
template<typename T> | |
static MD5 | compute (const T &t) |
compute MD5 digest for the provided object by first streaming it to a string | |
static MD5 | createFromStringRep (const std::string &s) |
convert the hex string representation back to a full-blown instance | |
Private Member Functions | |
MD5 (const value_type &val) | |
Private Attributes | |
value_type | m_value |
Classes | |
class | md5_engine |
Definition at line 21 of file MD5.h.
typedef boost::uint8_t Gaudi::Math::MD5::value_type[16] |
Gaudi::Math::MD5::MD5 | ( | ) | [inline] |
Gaudi::Math::MD5::MD5 | ( | const value_type & | val | ) | [inline, explicit, private] |
static MD5 Gaudi::Math::MD5::createInvalid | ( | ) | [inline, static] |
static MD5 Gaudi::Math::MD5::compute | ( | const std::string & | s | ) | [static] |
compute MD5 digest for the specified string
static MD5 Gaudi::Math::MD5::compute | ( | const T & | t | ) | [inline, static] |
string Gaudi::Math::MD5::str | ( | ) | const |
provide a hex string representation of the (internal) 128 bit value of the computed digest
Definition at line 72 of file MD5.cpp.
00072 { 00073 string s; s.reserve(2*sizeof(value_type)); 00074 for (const boost::uint8_t* i = m_value; i!=m_value+sizeof(value_type); ++i) { 00075 static const char *digits="0123456789abcdef"; 00076 s+=digits[(*i>>4)&0x0F]; s+=digits[(*i)&0x0F]; 00077 } 00078 return s; 00079 }
Gaudi::Math::MD5 Gaudi::Math::MD5::createFromStringRep | ( | const std::string & | s | ) | [static] |
convert the hex string representation back to a full-blown instance
Definition at line 93 of file MD5.cpp.
00093 { 00094 assert(val.size()==2*sizeof(Gaudi::Math::MD5::value_type) || val.empty()); 00095 if (val.empty()) return createInvalid(); 00096 Gaudi::Math::MD5::value_type d; 00097 for (size_t i=0;i<sizeof(d);++i) d[i]=(unhex(val[2*i])<<4|unhex(val[2*i+1])); 00098 return MD5(d); 00099 };
bool Gaudi::Math::MD5::invalid | ( | ) | const [inline] |
bool Gaudi::Math::MD5::valid | ( | ) | const [inline] |
bool Gaudi::Math::MD5::operator< | ( | const MD5 & | rhs | ) | const [inline] |
bool Gaudi::Math::MD5::operator> | ( | const MD5 & | rhs | ) | const [inline] |
bool Gaudi::Math::MD5::operator== | ( | const MD5 & | rhs | ) | const [inline] |
bool Gaudi::Math::MD5::operator<= | ( | const MD5 & | rhs | ) | const [inline] |
bool Gaudi::Math::MD5::operator>= | ( | const MD5 & | rhs | ) | const [inline] |
bool Gaudi::Math::MD5::operator!= | ( | const MD5 & | rhs | ) | const [inline] |
value_type Gaudi::Math::MD5::m_value [private] |