qt 獲取字符串的md5加密值


#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QString>
#include <QCryptographicHash>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    QString pwd="alibaba";
    QString md5;
    QByteArray ba,bb;
    QCryptographicHash md(QCryptographicHash::Md5);
    ba.append(pwd);
    md.addData(ba);
    bb=md.result();
    md5.append(bb.toHex());
    qDebug()<<md5;
    return a.exec();
}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM