标签:compute code style put hash byte ret coding class
public string GetMD5(string txt) { System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] frmData = System.Text.Encoding.UTF8.GetBytes(txt); byte[] targetData = md5.ComputeHash(frmData); string str = null; for (int i = 0; i < targetData.Length; i++) { str = str + targetData[i].ToString("x2"); } return str; }
标签:compute code style put hash byte ret coding class
原文地址:https://www.cnblogs.com/PinkMi/p/14258167.html