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 ().