Rudiments
Public Member Functions | List of all members
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::hash ( )
inline

Creates an instance of the hash class.

◆ ~hash()

virtual hash::~hash ( )
inlinevirtual

Deletes this instance of the hash class.

Member Function Documentation

◆ append()

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.

◆ clear()

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.

◆ getError()

virtual hasherror_t hash::getError ( )
pure virtual

Returns the most recent error.

Implemented in md5, and sha1.

◆ getHash()

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.

◆ getHashLength()

virtual uint32_t hash::getHashLength ( )
pure virtual

Returns the length of the hash in bytes.

Implemented in md5, and sha1.