Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/checksum/MD5.h>
Public Types | |
typedef unsigned char | digest_t [16] |
Public Member Functions | |
MD5 (void) | |
virtual | ~MD5 (void) |
void | digest (digest_t tab) |
void | print (io::Output &out) |
void | put (const void *buffer, t::uint32 length) |
void | put (const cstring &str) |
void | put (const string &str) |
void | put (io::InStream &in) |
void | put (io::InStream &in, int length) |
MD5 & | operator<< (const char *str) |
MD5 & | operator<< (const CString &str) |
MD5 & | operator<< (const String &str) |
template<class T > | |
MD5 & | operator<< (const T &value) |
virtual int | write (const char *buffer, int size) |
virtual int | flush (void) |
virtual cstring | lastErrorMessage (void) |
Public Member Functions inherited from elm::io::OutStream | |
virtual | ~OutStream (void) |
virtual int | write (char byte) |
Additional Inherited Members | |
Static Public Attributes inherited from elm::io::OutStream | |
static OutStream & | null = _null |
Apply the MD5 algorithm (http://fr.wikipedia.org/wiki/MD5) to compute a checksum.
Data are checksummed calling any one of the put() methods (or using the overloaded operator <<). When all data has been checksummed, the checksum value is returned by digest().
typedef unsigned char elm::checksum::MD5::digest_t[16] |
elm::checksum::MD5::MD5 | ( | void | ) |
Build a new MD5 checksum builder.
|
virtual |
void elm::checksum::MD5::digest | ( | digest_t | tab | ) |
Get the check as 512 bits byte array.
tab | Digest result. |
|
virtual |
Cause the current stream to dump its buffer to the medium.
Implements elm::io::OutStream.
|
virtual |
Return a message for the last error.
Reimplemented from elm::io::OutStream.
void elm::checksum::MD5::print | ( | io::Output & | out | ) |
Print the MD5 digest as an hexadecimal value.
References elm::io::hex(), elm::io::pad(), elm::io::right(), and elm::io::width().
Referenced by elm::checksum::operator<<().
void elm::checksum::MD5::put | ( | const void * | block, |
t::uint32 | length | ||
) |
Put a data block in the checksum.
block | Block address. |
length | Block length. |
References elm::min().
Referenced by operator<<(), put(), and write().
void elm::checksum::MD5::put | ( | const cstring & | str | ) |
Put a C string in the checksum.
str | C string to put in. |
References elm::CString::chars(), elm::CString::length(), and put().
void elm::checksum::MD5::put | ( | const string & | str | ) |
Put a string in the checksum.
str | String to put in. |
References elm::String::length(), and put().
void elm::checksum::MD5::put | ( | io::InStream & | in | ) |
Put an input stream in the buffer. Read to the end of the stream.
in | Input stream to read. |
io::IOException | If there is an error during stream read. |
References elm::io::InStream::read().
void elm::checksum::MD5::put | ( | io::InStream & | in, |
int | length | ||
) |
Put at most length bytes from the given stream to compute the MD5 checksum.
in | Input stream to read. |
length | Maximum number of bytes to read. |
io::IOException | If there is an error during stream read. |
References elm::min(), and elm::io::InStream::read().
|
virtual |
This is the main method of an output stream: the given buffer is put on the stream.
buffer | Byte buffer to write. |
size | Size of the byte buffer. |
Implements elm::io::OutStream.
References put().
t::uint32 elm::checksum::MD5::A |
t::uint32 elm::checksum::MD5::B |
t::uint32 elm::checksum::MD5::C |
t::uint32 elm::checksum::MD5::D |