60 virtual ~
Hash(
void) {};
73 bool update(
const quint8 *
const data,
const quint32 len) {
return process(data, len); }
84 bool update(
const QByteArray &data) {
return process(((
const quint8*)data.constData()), ((quint32)data.length())); }
95 bool update(QFile &file);
106 QByteArray
digest(
const bool bAsHex =
true) {
return bAsHex ? finalize().toHex() : finalize(); }
109 Hash(
const char* = NULL) {};
110 virtual bool process(
const quint8 *
const data,
const quint32 len) = 0;
111 virtual QByteArray finalize(
void) = 0;
128 MUTILS_API
Hash *
create(
const quint16 &hashId,
const char *
const key = NULL);
bool update(const QByteArray &data)
Process the next chunk of input data.
Definition: Hash.h:84
This file contains miscellaneous functions that are generally useful for Qt-based applications...
bool update(const quint8 *const data, const quint32 len)
Process the next chunk of input data.
Definition: Hash.h:73
static const quint16 HASH_BLAKE2_512
Hash algorithm identifier.
Definition: Hash.h:42
static const quint16 HASH_KECCAK_384
Hash algorithm identifier.
Definition: Hash.h:45
Global MUtils namespace.
Definition: CPUFeatures.h:37
#define MUTILS_NO_COPY(CLASS)
Disables copy constructor and assignment operator in the specified class. This macro should be used i...
Definition: Global.h:429
MUTILS_API Hash * create(const quint16 &hashId, const char *const key=NULL)
Create instance of a hash function.
This abstract class specifies the generic interface for all support hash algorithms.
Definition: Hash.h:57
static const quint16 HASH_KECCAK_256
Hash algorithm identifier.
Definition: Hash.h:44
static const quint16 HASH_KECCAK_224
Hash algorithm identifier.
Definition: Hash.h:43
QByteArray digest(const bool bAsHex=true)
Retrieve the hash value.
Definition: Hash.h:106
static const quint16 HASH_KECCAK_512
Hash algorithm identifier.
Definition: Hash.h:46