基于QT进行MD5值计算,安装版本为QT5.13.0,需要#include "QCryptographicHash"
QCryptographicHash类中Algorithm枚举了可以计算的类型。计算方式分为两种:通过addData接口动态计算,通过hash接口静态计算;图中截取了该类的公共接口
QCryptographicHash hash(QCryptographicHash::Md5);
hash.reset();
hash.addData(ui->source->toPlainText().toLocal8Bit());
ui->resault->setText(hash.result().toHex().data());
QByteArray value;
value = QCryptographicHash::hash(ui->source->toPlainText().toLocal8Bit(),QCryptographicHash::Md5);
ui->resault->setText(value.toHex().data());
原文:https://www.cnblogs.com/niu-li/p/12612455.html