#region Md5加密
public String EncryptCode(string pwd)
{
Byte[] clearBytes = new UnicodeEncoding().GetBytes(pwd);
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
String tt = BitConverter.ToString(hashedBytes).Replace("-", "");
return tt;
}
#endregion上面这段代码是.net的md5的函数,用PHP怎么来实现上面代码的功能?请指教,在线等,急~~
public String EncryptCode(string pwd)
{
Byte[] clearBytes = new UnicodeEncoding().GetBytes(pwd);
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
String tt = BitConverter.ToString(hashedBytes).Replace("-", "");
return tt;
}
#endregion上面这段代码是.net的md5的函数,用PHP怎么来实现上面代码的功能?请指教,在线等,急~~
例如 : $a = md5("123456");
$a 就是加密之后的 结果值了.