hash Class Referenceabstract

Inherited by md5, and sha1.

## Public Member Functions

| hash ()
virtual | ~hash ()
virtual bool | append (const unsigned char *data, uint32_t length)=0
virtual const unsigned char * | getHash ()=0
virtual uint32_t | getHashLength ()=0
virtual bool | clear ()=0
virtual hasherror_t | getError ()=0

## Detailed Description

The hash class provides a simple hash interface.

## Constructor & Destructor Documentation

hash::hash | ( |  | ) |

inline

Creates an instance of the hash class.

virtual hash::~hash | ( |  | ) |

inline virtual

Deletes this instance of the hash class.

## Member Function Documentation

virtual bool hash::append | ( | const unsigned char * | data,
|  | uint32_t | length
| ) |  |

pure virtual

Appends "length" bytes of "data" to the data to be hashed. Returns true on success or false if an error occurred.

Implemented in md5, and sha1.

virtual bool hash::clear | ( |  | ) |

pure virtual

Clears the current hash and any data that had previously been appended. Returns true on success or false if an error occurred.

Implemented in md5, and sha1.

virtual hasherror_t hash::getError | ( |  | ) |

pure virtual

Returns the most recent error.

Implemented in md5, and sha1.

virtual const unsigned char* hash::getHash | ( |  | ) |

pure virtual

Returns the current hash on success or NULL if an error occurred. Note that the current hash will be an empty string if no data has been appended yet.

Implemented in md5, and sha1.

virtual uint32_t hash::getHashLength | ( |  | ) |

pure virtual

Returns the length of the hash in bytes.

Implemented in md5, and sha1.