#include <md4.h>
Public Member Functions | |
| MD4Hash () | |
| The default constructor. | |
| ~MD4Hash () | |
| The destructor. | |
| int | Process (const void *_data, size_t _length) |
| Runs an MD4 hash on the data provided. | |
| int | Process (CrissCross::IO::CoreIOReader *_reader) |
| Runs a hash on the file provided. | |
| int | ProcessBlock (const void *_data, size_t _length) |
| Processes a piece of the dataset. | |
| void | Finalize () |
| Finalizes the ProcessBlock() calls and generates the final hash value. | |
| void | Reset () |
| Resets the internal MD4 context and hash buffer. | |
| const char * | ToString () const |
| Converts the internal hash data into an hex string, a human readable format. | |
| bool | operator== (const MD4Hash &_other) const |
| Equality operator. | |
| bool | operator!= (const MD4Hash &_other) const |
| Inequality operator. | |
MD4 hashes are rarely used anymore due to the advent of MD5. MD5 was created because several speculated that MD4 was vulnerable to collisions (that is, two different sets of initialization vectors could result in the same hash). However, MD5 has proven no more secure than MD4 in the long run, and an MD4 hash is generally faster to generate than an MD5 hash.
| bool operator!= | ( | const MD4Hash & | _other | ) | const [inline] |
| bool operator== | ( | const MD4Hash & | _other | ) | const |
| int Process | ( | CrissCross::IO::CoreIOReader * | _reader | ) |
Runs a hash on the file provided.
| _reader | The pre-opened CoreIOReader to run the hash on. |
| int Process | ( | const void * | _data, | |
| size_t | _length | |||
| ) |
Runs an MD4 hash on the data provided.
| _data | The data to hash. The buffer does not need to be null terminated. | |
| _length | The data length in bytes. |
| int ProcessBlock | ( | const void * | _data, | |
| size_t | _length | |||
| ) |
Processes a piece of the dataset.
This function will process only a segment of a larger dataset. It is designed to be called multiple times before an eventual Finalize() call.
| _data | The data segment to hash. | |
| _length | The length of the data segment in bytes. |
| const char* ToString | ( | ) | const |
Converts the internal hash data into an hex string, a human readable format.
The memory location returned by this function is freed when the class is destructed.
1.5.8