Bookmark and Share BitCoin Donate: 13t8gAWVpHP2ddxMp88d1NFpZjnFJC6UwK

Create a MD5 hash from a string

using System.Text;

namespace ashrdotnet{
     public class Security{

        private static string MD5(string data)
        {
            System.Security.Cryptography.MD5 hasher = System.Security.Cryptography.MD5.Create();
            char charData = data.ToCharArray();
            byte byteCharData = new bytecharData.Length;
            for(int i = 0;i < charData.Length;i++)
            {
                byteCharDatai = (byte)charDatai;
            }
            byte hashed = hasher.ComputeHash(byteCharData);
            StringBuilder sb = new StringBuilder();
            foreach (byte b in hashed) sb.Append(b.ToString());
            return sb.ToString();
        }
    }
}