天使半只翼

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

 

            System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            Random ra = new Random();
            var rr= ra.Next(1,100000);
            byte[] test = System.Text.Encoding.UTF8.GetBytes(rr.ToString());
            Console.WriteLine(rr);
            byte[] output = md5.ComputeHash(test);

            Console.WriteLine("md5-1:" + BitConverter.ToString(output).Replace("-",""));
            Console.WriteLine("md5-2:" + FormsAuthentication.HashPasswordForStoringInConfigFile(rr.ToString(), "MD5"));

 

posted on 2015-07-21 09:48  天使半只翼  阅读(480)  评论(0编辑  收藏  举报