X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=docs%2Fda%2Fdb0%2Fclass_m_utils_1_1_hash_1_1_hash.html;fp=docs%2Fda%2Fdb0%2Fclass_m_utils_1_1_hash_1_1_hash.html;h=50e03fc59cb241029dc722b7cb9231a67afaaf8b;hb=b6df766e60e1a6239c836c825c224cefb1644bda;hp=0000000000000000000000000000000000000000;hpb=f903add3e120e0084767a8cf60ad4305c5aa5c4a;p=mutilities%2FMUtilities.git diff --git a/docs/da/db0/class_m_utils_1_1_hash_1_1_hash.html b/docs/da/db0/class_m_utils_1_1_hash_1_1_hash.html new file mode 100644 index 0000000..50e03fc --- /dev/null +++ b/docs/da/db0/class_m_utils_1_1_hash_1_1_hash.html @@ -0,0 +1,271 @@ + + + + + + + +MuldeR's Utilities for Qt: MUtils::Hash::Hash Class Reference + + + + + + + + + +
+
+ + + + + + +
+
MuldeR's Utilities for Qt +
+
MUtilities
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+Public Member Functions | +Protected Member Functions | +List of all members
+
+
MUtils::Hash::Hash Class Referenceabstract
+
+
+ +

This abstract class specifies the generic interface for all support hash algorithms. + More...

+ +

#include <Hash.h>

+ + + + + + + + + + + + + + +

+Public Member Functions

bool update (const quint8 *const data, const quint32 len)
 Process the next chunk of input data. More...
 
bool update (const QByteArray &data)
 Process the next chunk of input data. More...
 
bool update (QFile &file)
 Process the next chunk of input data. More...
 
QByteArray digest (const bool bAsHex=true)
 Retrieve the hash value. More...
 
+ + + + + + + +

+Protected Member Functions

Hash (const char *key=NULL)
 
+virtual bool process (const quint8 *const data, const quint32 len)=0
 
+virtual QByteArray finalize (void)=0
 
+

Detailed Description

+

This abstract class specifies the generic interface for all support hash algorithms.

+

In order to compute a hash value (digest) call the the Hash::update() function repeatedly until all input data (i.e. the complete "message") has been processed. Then call the Hash::digest() function to retrieve the final hash value.

+

All overloads of the Hash::update() function may be called in an interleaved fashion as needed.

+

This class is not thread-safe, i.e. do not call the same Hash instance from difference threads, unless serialization is ensured (e.g. by means of a Mutex). It is safe, however, to call different different Hash instances from difference threads concurrently.

+

Member Function Documentation

+ +

§ digest()

+ +
+
+ + + + + +
+ + + + + + + + +
QByteArray MUtils::Hash::Hash::digest (const bool bAsHex = true)
+
+inline
+
+ +

Retrieve the hash value.

+

This function is used to retrieve the final hash value (digest), after all input data has been processed successfully.

+
Parameters
+ + +
bAsHexIf set to true, the function returns the hash value as a Hexadecimal-encoded ASCII string; if set to false, the function returns the hash value as "raw" bytes.
+
+
+
Returns
The function returns a QByteArray object holding the final hash value (digest). The format depends on the bAsHex parameter.
+ +
+
+ +

§ update() [1/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool MUtils::Hash::Hash::update (const quint8 *const data,
const quint32 len 
)
+
+inline
+
+ +

Process the next chunk of input data.

+

Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.

+
Parameters
+ + + +
dataA read-only pointer to the memory buffer holding the input data to be processed.
lenThe length of the input data, in bytes. The data parameter must be pointing to a memory buffer that is at least len bytes in size.
+
+
+
Returns
The function returns true, if the input data was processed successfully; otherwise it returns false.
+ +
+
+ +

§ update() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
bool MUtils::Hash::Hash::update (const QByteArray & data)
+
+inline
+
+ +

Process the next chunk of input data.

+

Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.

+
Parameters
+ + +
dataA read-only reference to a QByteArray object holding the input data to be processed. All bytes in the QByteArray object will be processed.
+
+
+
Returns
The function returns true, if the input data was processed successfully; otherwise it returns false.
+ +
+
+ +

§ update() [3/3]

+ +
+
+ + + + + + + + +
bool MUtils::Hash::Hash::update (QFile & file)
+
+ +

Process the next chunk of input data.

+

Updates the internal state of the hash function by processing the next chunk of input that. Can be called repeatedly, until until all input data has been processed.

+
Parameters
+ + +
dataA reference to a QFile object. The QFile object must be open and readable. All data from the current file position to the end of the file will be processed.
+
+
+
Returns
The function returns true, if all data in the file was processed successfully; otherwise (e.g. in case of file read errors) it returns false.
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + +