php md5 encode

D

daniel

the result of php language is below:

md5('don123494/1/24') = 5074456da7a19c2438cdf0e23728aca2

how can i get the same result as above in md5 of .net language
 
J

Jason Brown [MSFT]

try this
String MD5String(String strToEncode) {
ASCIIEncoding objEncode = new ASCIIEncoding();
byte[] btToEncode = objEncode.GetBytes(strToEncode);
MD5 objMD5 = new MD5CryptoServiceProvider();
byte[] btHashed = objMD5.ComputeHash(btToEncode);
return BitConverter.ToString(btHashed);
}-- Jason BrownMicrosoft GTSC, IISThis posting is provided "AS IS" with no
 
J

Jason Brown [MSFT]

hmm....

sorry about the lack of formatting there. let me try again

String MD5String(String strToEncode) {
ASCIIEncoding objEncode = new ASCIIEncoding();
byte[] btToEncode = objEncode.GetBytes(strToEncode);
MD5 objMD5 = new MD5CryptoServiceProvider();
byte[] btHashed = objMD5.ComputeHash(btToEncode);
return BitConverter.ToString(btHashed);
}


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no rights.

Jason Brown said:
try this
String MD5String(String strToEncode) {
ASCIIEncoding objEncode = new ASCIIEncoding();
byte[] btToEncode = objEncode.GetBytes(strToEncode);
MD5 objMD5 = new MD5CryptoServiceProvider();
byte[] btHashed = objMD5.ComputeHash(btToEncode);
return BitConverter.ToString(btHashed);
}-- Jason BrownMicrosoft GTSC, IISThis posting is provided "AS IS" with no
warranties said:
the result of php language is below:

md5('don123494/1/24') = 5074456da7a19c2438cdf0e23728aca2

how can i get the same result as above in md5 of .net language
 
D

daniel

thank you

i get it from
http://www.developmentnow.com/g/34_2005_1_0_0_41487/MD5_encode_diferent_from_Php.htm


Jason Brown said:
try this
String MD5String(String strToEncode) {
ASCIIEncoding objEncode = new ASCIIEncoding();
byte[] btToEncode = objEncode.GetBytes(strToEncode);
MD5 objMD5 = new MD5CryptoServiceProvider();
byte[] btHashed = objMD5.ComputeHash(btToEncode);
return BitConverter.ToString(btHashed);
}-- Jason BrownMicrosoft GTSC, IISThis posting is provided "AS IS" with no
warranties said:
the result of php language is below:

md5('don123494/1/24') = 5074456da7a19c2438cdf0e23728aca2

how can i get the same result as above in md5 of .net language
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top