QCryptographicHash
QCryptographicHash
Header: #include <QCryptographicHash>
qmake: QT += core
Since: Qt 4.3
注意:在5.9之前的Qt版本中,当被要求生成SHA3时,qcryptographicshash实际上计算了Keccak。如果您需要与Qt版本生成的SHA-3哈希兼容,请使用Keccak_u枚举器。或者,如果需要源兼容性,则定义宏QT_uSha3\u KECCAK_uUcompat。
Constant | Value | Description |
---|---|---|
QCryptographicHash::Md4 |
0 |
Generate an MD4 hash sum |
QCryptographicHash::Md5 |
1 |
Generate an MD5 hash sum |
QCryptographicHash::Sha1 |
2 |
Generate an SHA-1 hash sum |
QCryptographicHash::Sha224 |
3 |
Generate an SHA-224 hash sum (SHA-2). Introduced in Qt 5.0 |
QCryptographicHash::Sha256 |
4 |
Generate an SHA-256 hash sum (SHA-2). Introduced in Qt 5.0 |
QCryptographicHash::Sha384 |
5 |
Generate an SHA-384 hash sum (SHA-2). Introduced in Qt 5.0 |
QCryptographicHash::Sha512 |
6 |
Generate an SHA-512 hash sum (SHA-2). Introduced in Qt 5.0 |
QCryptographicHash::Sha3_224 |
RealSha3_224 |
Generate an SHA3-224 hash sum. Introduced in Qt 5.1 |
QCryptographicHash::Sha3_256 |
RealSha3_256 |
Generate an SHA3-256 hash sum. Introduced in Qt 5.1 |
QCryptographicHash::Sha3_384 |
RealSha3_384 |
Generate an SHA3-384 hash sum. Introduced in Qt 5.1 |
QCryptographicHash::Sha3_512 |
RealSha3_512 |
Generate an SHA3-512 hash sum. Introduced in Qt 5.1 |
QCryptographicHash::Keccak_224 |
7 |
Generate a Keccak-224 hash sum. Introduced in Qt 5.9.2 |
QCryptographicHash::Keccak_256 |
8 |
Generate a Keccak-256 hash sum. Introduced in Qt 5.9.2 |
QCryptographicHash::Keccak_384 |
9 |
Generate a Keccak-384 hash sum. Introduced in Qt 5.9.2 |
QCryptographicHash::Keccak_512 |
10 |
Generate a Keccak-512 hash sum. Introduced in Qt 5.9.2 |
void MainWindow::getMd5(QString pwdStr) { QString md5Str; QByteArray byteArray1, byteArray2; QCryptographicHash md(QCryptographicHash::Md5); byteArray1.append(pwdStr); md.addData(byteArray1); byteArray2 = md.result(); md5Str.append(byteArray2.toHex()); qDebug() << md5Str; return md5Str; }
Md5:
a94db642b34e5f34d75c14c5aeeda36f
Keccak_512:
a95c153b9bd4b32910b08c7d591866d949df2aa3e3fb62ed423ea5fd72c3e4ca05b2f1baa8a01fba9054a797589660f0988e22654ad3b0a77eee391b8bf5686b
################
QQ 3087438119
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2020-06-24 IfcBlock
2020-06-24 IfcCsgPrimitive3D
2019-06-24 osg MatrixManipulator CameraManipulator
2019-06-24 osg::MatrixTransform 模型基本变换