473,411 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

php md5 encode

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
Nov 19 '05 #1
3 1791
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, and confers no rights."daniel" <a9******@anet.net.tw> wrote in
message news:Om**************@TK2MSFTNGP09.phx.gbl...
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

Nov 19 '05 #2
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 [MSFT]" <i-******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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, and confers no rights."daniel" <a9******@anet.net.tw> wrote in
message news:Om**************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #3
thank you

i get it from
http://www.developmentnow.com/g/34_2...t_from_Php.htm
"Jason Brown [MSFT]" <i-******@online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:%2****************@TK2MSFTNGP09.phx .gbl...
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, and confers no rights."daniel" <a9******@anet.net.tw> wrote in
message news:Om**************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: francescomoi | last post by:
Hi. I'm trying to store a text within a MySQL field (v 3.23.58) by using MySQLdb (v 1.2.1c3). The text is: "telephone..." (note the last character) And I get this error message:...
5
by: Scott Matthews | last post by:
I've recently come upon an odd Javascript (and/or browser) behavior, and after hunting around the Web I still can't seem to find an answer. Specifically, I have noticed that the Javascript...
4
by: Newbie | last post by:
How would I modify this form to encode *all* the characters in the 'source' textarea to the '%xx' format & place result code into the 'output' textarea? (cross browser compatable) Any help is...
3
by: Peter | last post by:
Hi, I try to make up a javascript string which contains numeric numbers in any positions. For example, I want to make a string: secretcode, where secretcode.charAt(0)==(-21),...
1
by: AR | last post by:
I would like to know more about the Encode/Decode feature available within MS Access. This is what I have read from Microsoft Office OnLine: "The simplest method of protection is to encode the...
4
by: Darrel | last post by:
How does HTML.encode work? I'm trying to save text in a hidden form field into a SQL DB. The tedt is HTML (from a WYSIWYG editor...X-standard). One problem I have is that stray apostrophe's in...
7
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I...
6
by: 7stud | last post by:
s1 = "hello" s2 = s1.encode("utf-8") s1 = "an accented 'e': \xc3\xa9" s2 = s1.encode("utf-8") The last line produces the error: --- Traceback (most recent call last):
4
by: J Peyret | last post by:
Well, as usual I am confused by unicode encoding errors. I have a string with problematic characters in it which I'd like to put into a postgresql table. That results in a postgresql error so I...
1
by: anonymous | last post by:
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.