CS::Utility::Checksum::MD5 Class 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 (const void *, size_t nbytes) |
Encode a buffer. | |
static Digest | Encode (const char *) |
Encode a null-terminated string buffer. | |
static Digest | Encode (csString const &) |
Encode a string. | |
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 | |
md5_word_t | abcd [4] |
State of the MD5 Algorithm. | |
md5_byte_t | buf [64] |
State of the MD5 Algorithm. | |
size_t | count [2] |
State of the MD5 Algorithm. |
Detailed Description
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.
Definition at line 88 of file md5.h.
Member Typedef Documentation
typedef uint8 CS::Utility::Checksum::MD5::md5_byte_t [protected] |
typedef uint32 CS::Utility::Checksum::MD5::md5_word_t [protected] |
Member Function Documentation
void CS::Utility::Checksum::MD5::Append | ( | const uint8 * | input, | |
size_t | length | |||
) |
Used to update the the input data hash.
- Parameters:
-
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 | ( | const void * | , | |
size_t | nbytes | |||
) | [static] |
Encode a buffer.
static Digest CS::Utility::Checksum::MD5::Encode | ( | const char * | ) | [static] |
Encode a null-terminated string buffer.
Digest CS::Utility::Checksum::MD5::Finish | ( | ) |
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.
- Returns:
- The calculated hash.
Member Data Documentation
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] |
The documentation for this class was generated from the following file:
- csutil/md5.h
Generated for Crystal Space 2.0 by doxygen 1.6.1