版权声明:未经博主允许,禁止转载 https://blog.csdn.net/Think88666/article/details/84066055
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCryptographicHash hash(QCryptographicHash::Md5);
QString str("test");
hash.addData(str.toLatin1());
qDebug()<<hash.result().toHex();
return a.exec();
}