1.MD5加密
1 ///2 /// 使用MD5加密算法 3 /// 4 /// 需要加密的字符串 5 ///加密后返回字符串 6 public static string GetMD5String(string md5MessageStr) 7 { 8 using (MD5 md5 = new MD5CryptoServiceProvider()) 9 { 10 byte[] convertValue = Encoding.UTF8.GetBytes(md5MessageStr); 11 byte[] resultValue = md5.ComputeHash(convertValue); 12 string strResult = string.Empty; 13 for (int i = 0; i < 16; i++) 14 { 15 strResult += resultValue[i].ToString("x2"); 16 } 17 return strResult; 18 } 19 }
2.Zlib压缩解压缩
nuget获取zlib.net