CS::Utility::Checksum::MD5 Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions
CS::Utility::Checksum::MD5 Class Reference

Compute a MD5 message digest. More...

`#include <csutil/md5.h>`

List of all members.

## 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.

## 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 CS::Utility::Checksum::Digest<16> CS::Utility::Checksum::MD5::Digest

An MD5 digest is 16 unsigned characters (not 0-terminated).

Definition at line 109 of file md5.h.

typedef uint8 CS::Utility::Checksum::MD5::md5_byte_t`[protected]`

8-bit byte

Definition at line 92 of file md5.h.

typedef uint32 CS::Utility::Checksum::MD5::md5_word_t`[protected]`

32-bit word

Definition at line 94 of file md5.h.

## 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 | ( | 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.

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]`

State of the MD5 Algorithm.

Definition at line 99 of file md5.h.

md5_byte_t CS::Utility::Checksum::MD5::buf[64]`[protected]`

State of the MD5 Algorithm.

Definition at line 100 of file md5.h.

size_t CS::Utility::Checksum::MD5::count[2]`[protected]`

State of the MD5 Algorithm.

Definition at line 98 of file md5.h.

The documentation for this class was generated from the following file:

- csutil/md5.h