1. 程式人生 > >.net對含有中文的字符串進行MD5加密

.net對含有中文的字符串進行MD5加密

utf result crypto pla ace tolower 編碼 ice convert

MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
var Sign = BitConverter.ToString(MD5.ComputeHash(Encoding.GetEncoding("utf-8").GetBytes(result))).Replace("-", "").ToLower();

將編碼從gb2313改為utf-8。

.net對含有中文的字符串進行MD5加密