标签:com bsp 字符串 ons 效果 col 加密 tostring span
实现效果:
实现代码:
static void Main(string[] args) { Console.WriteLine("Enter a string to MD5 encryption...\n"); while (true) { Console.WriteLine(GetMD5(Console.ReadLine())); } } static string GetMD5(string str) { byte[] bts1 = Encoding.Default.GetBytes(str); MD5 md5 = MD5.Create(); StringBuilder result = new StringBuilder(); byte[] bts2 = md5.ComputeHash(bts1); foreach (byte item in bts2) { result.Append(item.ToString("x2")); } return result.ToString(); }
标签:com bsp 字符串 ons 效果 col 加密 tostring span
原文地址:https://www.cnblogs.com/feiyucha/p/10976436.html