Mega Code Archive

 
Categories / C# / Security
 

Md5 Hash (2)

using System; using System.Globalization; using System.IO; using System.Security.Cryptography; using System.Text; using System.Xml.Serialization; namespace DACU.Tools {   class Utils   {     public static string Md5Hash(string instr)     {       var strHash = new StringBuilder();       byte[] hash = new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(instr));       foreach (byte b in hash)         strHash.Append(b.ToString("x2"));       return strHash.ToString();     }   } }