zoukankan      html  css  js  c++  java
  • qtMd5 加密算法

           QString username = "admin";  

    1. String password = "admin123";    
    2. QString fileName="./pwd.txt";  
    3.        QFile file(fileName);  
    4. if(!file.open(QIODevice::ReadWrite | QIODevice::Text))  
    5.        {  
    6.           QMessageBox::warning(this,"warning","文件操作错误",QMessageBox::Yes);  
    7.        }  
    8.        QTextStream in(&file);  
    9. **********加密开始***********/  
    10.        QString usernamemd5;  
    11.        QString pwdmd5;  
    12.       QByteArray bb;  
    13.        bb = QCryptographicHash::hash ( password.toAscii(), QCryptographicHash::Md5 );  
    14.        pwdmd5.append(bb.toHex());  
    15.        bb = QCryptographicHash::hash(username.toAscii(),QCryptographicHash::Md5);  
    16.        usernamemd5.append(bb.toHex());  
    17. ***********加密结束****************/  
    18. //QMessageBox::warning(this,"warning",usernamemd5,QMessageBox::Yes);  
    19.        in<<usernamemd5+" ";  
    20.        in<<pwdmd5+" ";  
    21.        file.close();//到文件里看结果吧~当然用上面的消息框也可以哦  
    只有不断学习,才可进步。
  • 相关阅读:
    Flume基础(一):概述
    Hive高级(2):优化(2) 表的优化
    ospf命令
    Verizon 和某 BGP 优化器如何在今日大范围重创互联网
    BGP数据中心鉴别方法
    多线BGP鉴定
    mpls ldp neighbor 和loopbak
    ospf默认路由
    ospf
    ubuntu cloud init获取元数据失败
  • 原文地址:https://www.cnblogs.com/onlyforliu/p/5685623.html
Copyright © 2011-2022 走看看