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();//到文件里看结果吧~当然用上面的消息框也可以哦  
    只有不断学习,才可进步。
  • 相关阅读:
    Nginx中如何配置中文域名?
    VS2012找不到EF框架实体模型的解决方法
    来自一位家长的电话
    孩子大了真是不好管了
    springboot项目不加端口号也可以访问项目的方法
    分享几个上机案例题
    今晚在学校值班……
    3班的第二次模拟面试
    Sword 09
    Sword 06
  • 原文地址:https://www.cnblogs.com/onlyforliu/p/5685623.html
Copyright © 2011-2022 走看看