Qt 4.8
|
The QCryptographicHash class provides a way to generate cryptographic hashes. More...
#include <qcryptographichash.h>
Public Types | |
enum | Algorithm { Md4, Md5, Sha1 } |
Public Functions | |
void | addData (const char *data, int length) |
Adds the first length chars of data to the cryptographic hash. More... | |
void | addData (const QByteArray &data) |
QCryptographicHash (Algorithm method) | |
Constructs an object that can be used to create a cryptographic hash from data using method. More... | |
void | reset () |
Resets the object. More... | |
QByteArray | result () const |
Returns the final hash value. More... | |
~QCryptographicHash () | |
Destroys the object. More... | |
Static Public Functions | |
static QByteArray | hash (const QByteArray &data, Algorithm method) |
Returns the hash of data using method. More... | |
Properties | |
QCryptographicHashPrivate * | d |
The QCryptographicHash class provides a way to generate cryptographic hashes.
QCryptographicHash can be used to generate cryptographic hashes of binary or text data.
Currently MD4, MD5, and SHA-1 are supported.
Definition at line 55 of file qcryptographichash.h.
Enumerator | |
---|---|
Md4 | |
Md5 | |
Sha1 |
Definition at line 58 of file qcryptographichash.h.
QCryptographicHash::QCryptographicHash | ( | Algorithm | method | ) |
Constructs an object that can be used to create a cryptographic hash from data using method.
Definition at line 98 of file qcryptographichash.cpp.
QCryptographicHash::~QCryptographicHash | ( | ) |
void QCryptographicHash::addData | ( | const char * | data, |
int | length | ||
) |
Adds the first length chars of data to the cryptographic hash.
Definition at line 136 of file qcryptographichash.cpp.
Referenced by addData(), digestMd5ResponseHelper(), hash(), qCreatev2Hash(), qEncodeHmacMd5(), qmlsqldatabase_open_sync(), qStringFromUcs2Le(), and QNetworkDiskCachePrivate::uniqueFileName().
void QCryptographicHash::addData | ( | const QByteArray & | data | ) |
Definition at line 155 of file qcryptographichash.cpp.
|
static |
Returns the hash of data using method.
Definition at line 196 of file qcryptographichash.cpp.
Referenced by QSslCertificate::digest(), QSharedMemoryPrivate::makePlatformSafeKey(), QDeclarativeEnginePrivate::md5(), and QAuthenticatorPrivate::QAuthenticatorPrivate().
void QCryptographicHash::reset | ( | ) |
Resets the object.
Definition at line 116 of file qcryptographichash.cpp.
Referenced by digestMd5ResponseHelper(), QCryptographicHash(), and qEncodeHmacMd5().
QByteArray QCryptographicHash::result | ( | ) | const |
Returns the final hash value.
Definition at line 165 of file qcryptographichash.cpp.
Referenced by digestMd5ResponseHelper(), hash(), qCreatev2Hash(), qEncodeHmacMd5(), qmlsqldatabase_open_sync(), qStringFromUcs2Le(), and QNetworkDiskCachePrivate::uniqueFileName().
|
private |
Definition at line 77 of file qcryptographichash.h.
Referenced by addData(), QCryptographicHash(), reset(), result(), and ~QCryptographicHash().