RosettaCodeData/Task/MD5-Implementation/C-sharp/md5-implementation-2.cs
2015-11-18 06:14:39 +00:00

9 lines
409 B
C#

System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bs = System.Text.Encoding.UTF8.GetBytes(password);
bs = x.ComputeHash(bs); //this function is not in the above classdefinition
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs)
{
s.Append(b.ToString("x2").ToLower());
}
password = s.ToString();