WikiFunctions.Tools.GetMd5Sum C# (CSharp) Method

GetMd5Sum() public static method

Calculates md5sum of a string, see http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5%28v=vs.110%29.aspx
public static GetMd5Sum ( string input ) : string
input string
return string
        public static string GetMd5Sum(string input)
        {
            System.Security.Cryptography.MD5 md5Hasher = System.Security.Cryptography.MD5.Create();

            byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));

            StringBuilder res = new StringBuilder();

            // Format each byte as a hexadecimal string.
            foreach (byte t in data)
            {
                res.Append(t.ToString("x2"));
            }

            return res.ToString();
        }
Tools