The QCryptographicHash class provides a way to generate cryptographic hashes. 更多...
| 头: | #include <QCryptographicHash> |
| Since: | Qt 4.3 |
注意: 此类的所有函数 可重入 .
| enum | Algorithm { Md4, Md5, Sha1 } |
| QCryptographicHash (Algorithm method ) | |
| ~QCryptographicHash () | |
| void | addData (const char * data , int length ) |
| void | addData (const QByteArray & data ) |
| void | reset () |
| QByteArray | result () const |
| QByteArray | hash (const QByteArray & data , Algorithm method ) |
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.
| 常量 | 值 | 描述 |
|---|---|---|
QCryptographicHash::Md4
|
0
|
生成 MD4 哈希和 |
QCryptographicHash::Md5
|
1
|
生成 MD5 哈希和 |
QCryptographicHash::Sha1
|
2
|
Generate an SHA1 hash sum |
构造可用于从数据创建加密哈希的对象,使用 method .
销毁对象。
Adds the first length chars of data to the cryptographic hash.
此函数重载 addData ().
[static]
QByteArray
QCryptographicHash::
hash
(const
QByteArray
&
data
,
Algorithm
method
)
返回哈希为 data 使用 method .
重置对象。
返回最终的哈希值。
另请参阅 QByteArray::toHex ().