#include <QByteArray>
#include <QFile>
#include <QCryptographicHash>
#include <QDebug>
int main(int argc, char **argv)
{
QString filePath = argv[1];
QFile theFile(filePath);
theFile.open(QIODevice::ReadOnly);
QByteArray ba = QCryptographicHash::hash(theFile.readAll(),QCryptographicHash::Md5);
theFile.close();
qDebug() << ba.toHex().constData();
}
QT获取MD5
最新推荐文章于 2024-03-14 18:05:50 发布