QCryptographicHash 類

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.

成員類型文檔編製

enum QCryptographicHash:: Algorithm

常量 描述
QCryptographicHash::Md4 0 生成 MD4 哈希和
QCryptographicHash::Md5 1 生成 MD5 哈希和
QCryptographicHash::Sha1 2 Generate an SHA1 hash sum

成員函數文檔編製

QCryptographicHash:: QCryptographicHash ( Algorithm method )

構造可用於從數據創建加密哈希的對象,使用 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 )

此函數重載 addData ().

[static] QByteArray QCryptographicHash:: hash (const QByteArray & data , Algorithm method )

返迴哈希為 data 使用 method .

void QCryptographicHash:: reset ()

重置對象。

QByteArray QCryptographicHash:: result () const

返迴最終的哈希值。

另請參閱 QByteArray::toHex ().