The QCryptographicHash class provides a way to generate cryptographic hashes.
More...
The QCryptographicHash class provides a way to generate cryptographic hashes. QCryptographicHash can be used to generate cryptographic hashes of binary or text data.
Refer to the documentation of the QCryptographicHash::Algorithm enum for a list of the supported algorithms.
- See also
- QByteArray::toHex()
This enum is used to specify which hash function is computed.
Constant | Value | Description |
QCryptographicHash::Md4 | 0 | Generate MD4 hash sum |
QCryptographicHash::Md5 | 1 | Generate MD5 hash sum |
QCryptographicHash::Sha1 | 2 | Generate SHA-1 hash sum |
QCryptographicHash::Sha224 | 3 | Generate SHA-224 hash sum (SHA-2) |
QCryptographicHash::Sha256 | 4 | Generate SHA-256 hash sum (SHA-2) |
QCryptographicHash::Sha384 | 5 | Generate SHA-384 hash sum (SHA-2) |
QCryptographicHash::Sha512 | 6 | Generate SHA-512 hash sum (SHA-2) |
QCryptographicHash::Keccak_224 | 7 | Generate Keccak-224 hash sum |
QCryptographicHash::Keccak_256 | 8 | Generate Keccak-256 hash sum |
QCryptographicHash::Keccak_384 | 9 | Generate Keccak-384 hash sum |
QCryptographicHash::Keccak_512 | 10 | Generate Keccak-512 hash sum |
QCryptographicHash::Sha3_224 | 11 | Generate SHA-224 hash sum (SHA-3) |
QCryptographicHash::Sha3_256 | 12 | Generate SHA-256 hash sum (SHA-3) |
QCryptographicHash::Sha3_384 | 13 | Generate SHA-384 hash sum (SHA-3) |
QCryptographicHash::Sha3_512 | 14 | Generate SHA-512 hash sum (SHA-3) |
QCryptographicHash::QCryptographicHash |
( |
Algorithm |
method | ) |
|
|
explicit |
Constructs an object that can be used to create a cryptographic hash from data using method.
QCryptographicHash::~QCryptographicHash |
( |
| ) |
|
void QCryptographicHash::addData |
( |
const char * |
data, |
|
|
int |
length |
|
) |
| |
Adds the first length chars of data to the cryptographic hash.
void QCryptographicHash::addData |
( |
const QByteArray & |
data | ) |
|
Adds the data to the cryptographic hash.
bool QCryptographicHash::addData |
( |
QIODevice * |
device | ) |
|
Reads data from the open device until it ends and hashes it. Returns true if reading was successful.
Returns the hash of data using method.
void QCryptographicHash::reset |
( |
| ) |
|