文字列回転MD 5

2014 ワード

 1         public static string Md5Encrypt(string pwd)

 2         {

 3             MD5 md5 = MD5.Create();

 4             byte[] byts = System.Text.Encoding.UTF8.GetBytes(pwd);

 5             byte[] bytsMd5 = md5.ComputeHash(byts);

 6             md5.Clear();// ,Dispose .

 7             StringBuilder sb = new StringBuilder();

 8             for (int i = 0; i < bytsMd5.Length; i++)

 9             {

10                 sb.Append(bytsMd5[i].ToString("x2"));

11             }

12             return sb.ToString();

13         }