php md5 encode

  • Thread starter Thread starter daniel
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top