![]() |
Public API Reference |
![]() |
Compute a MD5 message digest. More...
#include <csutil/md5.h>
Public Types | |
typedef CS::Utility::Checksum::Digest< 16 > | Digest |
An MD5 digest is 16 unsigned characters (not 0-terminated). | |
Public Member Functions | |
void | Append (const uint8 *input, size_t length) |
Used to update the the input data hash. | |
Digest | Finish () |
Used to complete the hashing process and obtain the calculated hash. | |
Static Public Member Functions | |
static Digest | Encode (csString const &) |
Encode a string. | |
static Digest | Encode (const char *) |
Encode a null-terminated string buffer. | |
static Digest | Encode (const void *, size_t nbytes) |
Encode a buffer. | |
Protected Types | |
typedef uint8 | md5_byte_t |
8-bit byte | |
typedef uint32 | md5_word_t |
32-bit word | |
Protected Member Functions | |
void | AppendInternal (const uint8 *input, uint32 length) |
Update hash with a (at most) 4GB chunk of data. | |
Protected Attributes | |
size_t | count [2] |
State of the MD5 Algorithm. | |
md5_word_t | abcd [4] |
State of the MD5 Algorithm. | |
md5_byte_t | buf [64] |
State of the MD5 Algorithm. |
Compute a MD5 message digest.
This is an encapsulation of a C-implementation of MD5 digest algorithm by Peter Deutsch <ghost@aladdin.com>.
It provides an interface to compute a digest in a "streaming" manner (the message can be split into chunks which are processed sequentially) as well as a convenient interface which allows one to create a digest in a single step.
typedef uint8 CS::Utility::Checksum::MD5::md5_byte_t [protected] |
typedef uint32 CS::Utility::Checksum::MD5::md5_word_t [protected] |
void CS::Utility::Checksum::MD5::Append | ( | const uint8 * | input, |
size_t | length | ||
) |
Used to update the the input data hash.
input | A pointer to an array of the input data with which to update the hash. |
length | The length of the input data to hash (in bytes). |
void CS::Utility::Checksum::MD5::AppendInternal | ( | const uint8 * | input, |
uint32 | length | ||
) | [protected] |
Update hash with a (at most) 4GB chunk of data.
static Digest CS::Utility::Checksum::MD5::Encode | ( | csString const & | ) | [static] |
Encode a string.
static Digest CS::Utility::Checksum::MD5::Encode | ( | const char * | ) | [static] |
Encode a null-terminated string buffer.
static Digest CS::Utility::Checksum::MD5::Encode | ( | const void * | , |
size_t | nbytes | ||
) | [static] |
Encode a buffer.
Used to complete the hashing process and obtain the calculated hash.
After finishing, don't append further data to the hash -- the resulting digest will be bogus.
md5_word_t CS::Utility::Checksum::MD5::abcd[4] [protected] |
md5_byte_t CS::Utility::Checksum::MD5::buf[64] [protected] |
size_t CS::Utility::Checksum::MD5::count[2] [protected] |