feiyucha

实现效果:

  

实现代码:

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();
        }

 

分类:

技术点:

相关文章:

  • 2022-02-09
  • 2022-01-06
  • 2022-01-01
  • 2021-12-23
  • 2021-11-30
  • 2021-11-30
  • 2022-01-02
  • 2021-12-25
猜你喜欢
  • 2021-12-25
  • 2022-01-01
  • 2021-11-29
  • 2021-12-02
  • 2021-12-11
  • 2021-12-13
  • 2021-11-20
相关资源
相似解决方案