KMD4 Class Reference

`#include <kmdcodec.h>`

## Public Types

typedef unsigned char | Digest [16]

## Public Member Functions

| KMD4 (const char *in, int len=-1)
| KMD4 (const QByteArray &a)
| KMD4 (const QCString &a)
void | update (const char *in, int len=-1)
void | update (const unsigned char *in, int len=-1)
void | update (const QByteArray &in)
void | update (const QCString &in)
bool | update (QIODevice &file)
void | reset ()
const Digest & | rawDigest ()
void | rawDigest (KMD4::Digest &bin)
QCString | hexDigest ()
void | hexDigest (QCString &)
QCString | base64Digest ()
bool | verify (const KMD4::Digest &digest)
bool | verify (const QCString &)

## Protected Member Functions

void | transform (Q_UINT32 buf[4], Q_UINT32 const in[16])
void | finalize ()

## Detailed Description

An adapted C++ implementation of the MD4 Message-Digest algorithm.

Since
  3.4

The class usage is the same as KMD5.

Definition at line 577 of file kmdcodec.h.

## Constructor & Destructor Documentation

KMD4::KMD4 | ( | const char * | in,
|  | int | len = `-1`
| ) |  |

Constructor that updates the digest for the given string.

Parameters

  in | C string or binary data
  len | if negative, calculates the length by using strlen on the first parameter, otherwise it trusts the given length (does not stop on NUL byte).

Definition at line 1148 of file kmdcodec.cpp.

KMD4::KMD4 | ( | const QByteArray & | a | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as above except it accepts a QByteArray as its argument.

Definition at line 1154 of file kmdcodec.cpp.

KMD4::KMD4 | ( | const QCString & | a | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Same as above except it accepts a QCString as its argument.

Definition at line 1160 of file kmdcodec.cpp.

## Member Function Documentation

QCString KMD4::base64Digest | ( |  | ) |

Returns the value of the calculated message digest in a base64-encoded representation.

Definition at line 1347 of file kmdcodec.cpp.

void KMD4::finalize | ( |  | ) |

protected

finalizes the digest

Definition at line 1253 of file kmdcodec.cpp.

QCString KMD4::hexDigest | ( |  | ) |

Returns the value of the calculated message digest in a hexadecimal representation.

Definition at line 1324 of file kmdcodec.cpp.

void KMD4::hexDigest | ( | QCString & | s | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1337 of file kmdcodec.cpp.

const KMD4::Digest & KMD4::rawDigest | ( |  | ) |

Returns
  the raw representation of the digest

Definition at line 1312 of file kmdcodec.cpp.

void KMD4::rawDigest | ( | KMD4::Digest & | bin | ) |

Fills the given array with the binary representation of the message digest.

Use this method if you do not want to worry about making copy of the digest once you obtain it.

Parameters

  bin | an array of 16 characters ( char[16] )

Definition at line 1318 of file kmdcodec.cpp.

void KMD4::reset | ( |  | ) |

Calling this function will reset the calculated message digest.

Use this method to perform another message digest calculation without recreating the KMD4 object.

Definition at line 1367 of file kmdcodec.cpp.

void KMD4::transform | ( | Q_UINT32 | buf[4],
|  | Q_UINT32 const | in[16]
| ) |  |

protected

Performs the real update work.

Note that length is implied to be 64.

Definition at line 1445 of file kmdcodec.cpp.

void KMD4::update | ( | const char * | in,
|  | int | len = `-1`
| ) |  |

inline

Updates the message to be digested.

Be sure to add all data before you read the digest. After reading the digest, you can not add more data!

Parameters

  in | message to be added to digest
  len | the length of the given message.

Definition at line 617 of file kmdcodec.h.

void KMD4::update | ( | const unsigned char * | in,
|  | int | len = `-1`
| ) |  |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1180 of file kmdcodec.cpp.

void KMD4::update | ( | const QByteArray & | in | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  in | message to be added to the digest (QByteArray).

Definition at line 1166 of file kmdcodec.cpp.

void KMD4::update | ( | const QCString & | in | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  in | message to be added to the digest (QCString).

Definition at line 1171 of file kmdcodec.cpp.

bool KMD4::update | ( | QIODevice & | file | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.reads the data from an I/O device, i.e.

from a file (QFile).

NOTE that the file must be open for reading.

Parameters

  file | a pointer to FILE as returned by calls like f{d,re}open

Returns
  false if an error occurred during reading.

Definition at line 1238 of file kmdcodec.cpp.

bool KMD4::verify | ( | const KMD4::Digest & | digest | ) |

returns true if the calculated digest for the given message matches the given one.

Definition at line 1300 of file kmdcodec.cpp.

bool KMD4::verify | ( | const QCString & | hexdigest | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1306 of file kmdcodec.cpp.

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

- kmdcodec.h
- kmdcodec.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys