3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
C# 能吻合 PHP 的MD5運算函數             static public String MD5_BASE64forPHP(String StrData)         {             //https://stackoverflow.com/questions/5821677/md5-hashing-does-not-match-in-c-sharp-and-php             //https://www.tools4noobs.com/online_php_functions/md5/             //https://www.tools4noobs.com/online_php_functions/base64_encode/             String StrAns = “”;             byte[] asciiBytes = ASCIIEncoding.ASCII.GetBytes(StrData);             byte[] hashedBytes = MD5CryptoServiceProvider.Create().ComputeHash(asciiBytes);             string hashedString = BitConverter.ToString(hashedBytes).Replace(“-“, “”).ToLower();             StrAns = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(hashedString));//把加密後的字串從Byte[]轉為字串             return StrAns;         }

本文由jashliaoeuwordpress提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦