CSharp examples for Security:MD5
Get md5 string for a String
using System.Text; using System.IO;// w w w . j a va 2 s . c om using System; public class Main{ /// <summary> /// Get md5 string for a String /// </summary> /// <param name="value">Source String</param> /// <returns>md5 string</returns> public static string GetMD5ForString(string value) { string md5String = string.Empty; if (value != string.Empty) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); md5String = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(value))).Replace("-", string.Empty); } return md5String; } }