TigerHash Class Reference

A Tiger hash generator. More...

#include <tiger.h>

List of all members.

Public Member Functions

 TigerHash ()
 The default constructor.
 ~TigerHash ()
 The destructor.
int Process (const void *_data, size_t _length)
 Runs a Tiger hash on the data provided.
int Process (CrissCross::IO::CoreIOReader *_reader)
 Runs a hash on the file provided.
int ProcessBlock (const void *_data, size_t _length)
 Processes a piece of the dataset.
void Finalize ()
 Finalizes the ProcessBlock() calls and generates the final hash value.
void Reset ()
 Resets the internal Tiger context and hash buffer.
const char * ToString () const
 Converts the internal hash data into an hex string, a human readable format.
bool operator== (const TigerHash &_other) const
 Equality operator.
bool operator!= (const TigerHash &_other) const
 Inequality operator.


Detailed Description

A Tiger hash generator.

Warning:
When compiled as 32-bit code, this hash is particularly slow. When compiled as 64-bit code, this hash type can actually be faster to generate than a SHA-256 hash or even a SHA-512 hash.
See also:
Hash SHA1Hash SHA256Hash SHA512Hash

Member Function Documentation

bool operator!= ( const TigerHash _other  )  const [inline]

Inequality operator.

Compares two instances of TigerHash to see if the hashes are not equal.

Parameters:
_other The other instance of TigerHash to compare to.

bool operator== ( const TigerHash _other  )  const

Equality operator.

Compares two instances of TigerHash to see if the hashes are equal.

Parameters:
_other The other instance of TigerHash to compare to.

int Process ( CrissCross::IO::CoreIOReader _reader  ) 

Runs a hash on the file provided.

Parameters:
_reader The pre-opened CoreIOReader to run the hash on.
Returns:
Zero on success, nonzero on failure.

int Process ( const void *  _data,
size_t  _length 
)

Runs a Tiger hash on the data provided.

Parameters:
_data The data to hash. The buffer does not need to be null terminated.
_length The data length in bytes.
Returns:
Zero on success, nonzero on failure.

int ProcessBlock ( const void *  _data,
size_t  _length 
)

Processes a piece of the dataset.

This function will process only a segment of a larger dataset. It is designed to be called multiple times before an eventual Finalize() call.

Parameters:
_data The data segment to hash.
_length The length of the data segment in bytes.

const char* ToString (  )  const

Converts the internal hash data into an hex string, a human readable format.

The memory location returned by this function is freed when the class is destructed.

Warning:
There's no standardized Tiger hex output format yet. It's highly recommended that hashes generated by this class ONLY be compared with hashes generated by another instance of this class.


Generated on Sun Feb 8 11:09:59 2009 for CrissCross by  doxygen 1.5.8