MD5 encryption algorithm used for login accounts in C#

大家讲道理
Release: 2016-11-10 14:58:30
Original
1494 people have browsed it

public static string GetMD5(string sDataIn)  
       {  
           MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();  
           byte[] bytValue, bytHash;  
           bytValue = System.Text.Encoding.UTF8.GetBytes(sDataIn);  
           bytHash = md5.ComputeHash(bytValue);  
           md5.Clear();  
           string sTemp = "";  
           for (int i = 0; i < bytHash.Length; i++)  
           {  
               sTemp += bytHash[i].ToString("X").PadLeft(2, &#39;0&#39;);  
           }  
           return sTemp.ToLower();  
       }
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template