1. 程式人生 > >qt實現md5加密

qt實現md5加密

#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();
}