/// <summary>
/// 用户密码加密
/// 张晓磊
/// </summary>
/// <param name="data">需要加密的参数</param>
/// <returns></returns>
private string MD5Sign(string key, params object[] args)
{
var list = new List<string>();
list.AddRange(args.Select(x => (x ?? string.Empty).ToString()));
list.Sort();
string strData = string.Join("|", list);
if (!string.IsNullOrEmpty(key))
{
strData = string.Join("|", list) + "&key=" + key;
}
//密码:md5加密方式(guid,|,用户密码)
var pwds = Crypto.Hash(HashFlag.MD5).SignData(strData);
//将byte数组转换为16进制的字符串形式
return strData = Crypto.ToHexString(pwds);
}
转载于:https://www.cnblogs.com/zhangxiaolei521/p/5216132.html