怎么让C#的加密跟PHP的加密一样呢

WBOY
Release: 2016-06-13 13:44:05
Original
774 people have browsed it

如何让C#的加密跟PHP的加密一样呢?
我现在有C#的加密方法
public static string GetMD5(string s, string _input_charset)
  {
  MD5 md5 = new MD5CryptoServiceProvider();
byte[] t = md5.ComputeHash(Encoding.GetEncoding(_input_charset).GetBytes(s));
StringBuilder sb = new StringBuilder(32);
for (int i = 0; i   {
sb.Append(t[i].ToString("x").PadLeft(2, '0'));
  }
return sb.ToString();
  }
如何让这个方法变成php的加密方法呢?

求各位大虾解决问题

------解决方案--------------------
_input_charset
难道是这个的区别?
PHP没有这个字符集参数。
------解决方案--------------------
你需要给出 2~10 组 明文 及 GetMD5 的结果

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template