zoukankan      html  css  js  c++  java
  • QCryptographicHash

    QCryptographicHash 

    Header: #include <QCryptographicHash>
    qmake: QT += core
    Since: Qt 4.3

    注意:在5.9之前的Qt版本中,当被要求生成SHA3时,qcryptographicshash实际上计算了Keccak。如果您需要与Qt版本生成的SHA-3哈希兼容,请使用Keccak_u枚举器。或者,如果需要源兼容性,则定义宏QT_uSha3u KECCAK_uUcompat。

    ConstantValueDescription
    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
  • 相关阅读:
    结对-结对编程项目作业名称-结对项目总结
    课后作业 -团队项目编程进度
    团队-象棋游戏-模块开发过程
    团队-象棋游戏-模块测试过程
    结队-结队编程项目作业名称-项目进度
    课后作业-阅读任务-阅读笔记-3
    团队-象棋游戏-需求分析
    团队-象棋游戏-成员简介及分工
    课后作业 -团队项目编程进度
    团队编程 象棋游戏 开发文档
  • 原文地址:https://www.cnblogs.com/herd/p/14925731.html
Copyright © 2011-2022 走看看