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
  • 相关阅读:
    小程序 的授权登陆
    ant desgin pro 项目中的 数据流方案
    new Date() 日期格式处理
    小程序手写 的选择日期 区间
    小程序中的slot(插槽)
    微信小程序实现城市选择和城市切换
    微信小程序 使用页面栈 修改上一个页面的data数据
    2021/2/25
    2021/2/24
    2021/2/23
  • 原文地址:https://www.cnblogs.com/herd/p/14925731.html
Copyright © 2011-2022 走看看