Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c#编码到PHP编码_C#_Php_Asp.net - Fatal编程技术网

c#编码到PHP编码

c#编码到PHP编码,c#,php,asp.net,C#,Php,Asp.net,我有一个ASP项目,其中使用了一些编码算法来保存密码。我必须将c#代码转换为PHP代码,以便将密码与SQL数据库中的表值进行比较 c#中用于编码的代码是 MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider(); Byte[] hashedDataBytes; UTF8Encoding encoder = new UTF8Encoding(); hashedDataBytes = md5Hasher.ComputeHa

我有一个ASP项目,其中使用了一些编码算法来保存密码。我必须将c#代码转换为PHP代码,以便将密码与SQL数据库中的表值进行比较

c#中用于编码的代码是

MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider();
Byte[] hashedDataBytes;
UTF8Encoding encoder = new UTF8Encoding();
hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(password));
现在在注册时,我输入了密码“123456”,当我检查表Customers时,保存的密码是0xE10ADC3949BA59ABBE56E057F20F883E000000000000000000000000000000000

表中的列结构是Password(二进制(50),null)

有人能告诉我在PHP中应该使用什么代码来比较“123456”吗
0xE10ADC3949BA59ABBE56E057F20F883E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000

您必须检查类MD5CryptoServiceProvider中的ComputeHash方法 并用PHP编写一个类似的类/方法 有了这段代码,没人能帮你