NShaHash Class Reference

NShaHash class is the class definition for sha hash calculation algorithm. More...

Inheritance diagram for NShaHash:

NAbstractHash NObject

List of all members.

Public Member Functions

 NShaHash (void)
 Constructs a NShaHash object.
 ~NShaHash (void)
 Destroys a NShaHash object.
NHash calculate (const NString &str)
 Calculates the hash of a given string.
NHash calculate (const NDataStream &data, nint32 size)
 Calculates the hash of arbitrary data.
NHash calculateFile (const NString &filename)
 Calculates the hash of a file.
NHash calculateFile (NFile *file)
 Calculates the hash of a file.


Detailed Description

NShaHash class is the class definition for sha hash calculation algorithm.

See also:
NAbstractHash for inherited methods
Examples:

hashapp.cpp.

Definition at line 43 of file nshahash.h.


Member Function Documentation

NHash calculate ( const NString str  )  [virtual]

Calculates the hash of a given string.

Parameters:
str The string to calculate the hash
Returns:
A NHash object with the value of the string

Implements NAbstractHash.

Definition at line 39 of file nshahash.cpp.

References NAbstractHash::cleanup(), NString::length(), NString::toChar(), and NAbstractHash::update().

NHash calculate ( const NDataStream data,
nint32  size 
) [virtual]

Calculates the hash of arbitrary data.

Parameters:
data The data to be calculated
size Number of bytes to calculate the hash
Returns:
A NHash object with the value of the string

Implements NAbstractHash.

Definition at line 49 of file nshahash.cpp.

References NAbstractHash::cleanup(), NDataStream::data(), and NAbstractHash::update().

NHash calculateFile ( const NString filename  )  [virtual]

Calculates the hash of a file.

Parameters:
filename The full path to the file to calculate
Returns:
A NHash object with the value of the string

Implements NAbstractHash.

Definition at line 59 of file nshahash.cpp.

References NIODevice::ReadOnly.

NHash calculateFile ( NFile file  )  [virtual]

Calculates the hash of a file.

Parameters:
file A pointer to an open NFile object
Returns:
A NHash object with the value of the string

Implements NAbstractHash.

Definition at line 67 of file nshahash.cpp.

References NFile::atEnd(), NAbstractHash::cleanup(), NDataStream::data(), NFile::read(), NDataStream::size(), and NAbstractHash::update().


The documentation for this class was generated from the following files:
Generated on Wed Mar 5 23:10:37 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4