Dear Folks,
I am no good in data structure and algorithm specially due to very rich collection api of
java. But now-a-days I am working on a few projects that requires language independent solutions to DSA problems. I was thinking to attend an online training course on that...short (may be in C++) but effective so that after the course I can carry on myself. If you know a few links, please let me know (I tried google and got so many links that made me lost in forest).
One of my recently developer java xmlrpc client works fine that interacts with an xmlrpc server developed in python. Now I need to do md5 checksum of my sent data to the server that also checks whether data was modified during transport. But the data I get after digest is not matching with the data produced as a result of MD5 digesting by my python server. As I know, MD5 is a non-reversable(or almost?!) two-step way to generate a checksum value that should generate the same checksum every time the same input is given to digest. Then as my one is not matching, I am a little worried where am I making the mistake? The current digest is accepted by the python server but that doesn't that help me.
I tested generating though python's code the "Hello World"
string and got this following digest - b10a8db164e0754105b7a99be72e3fe5
But when I print it in Java, it gets me.
I tried it in PHP to see if "Hello World" gives the same value. Yes, the following code generates the same.
The following methods are used in one of my utility class.
The value I get are -
������*$���v
or when padded the bytes
ffffffb3ffffff8bffffffe257f99ffffff92ffffff88fffffff62a24ffffffe1ffffff8affffffc476
The problem is XMLRPC sends good XML content via HTTP and so it can't send this sort of bytes-looking data, this contradicts with the XML encoding while trying to wrap up over the wire.
Then I tried preparing padHexString() (with hope to make single byte 0-9 as 00-09) and returnHexString() (with hope I'll get something out of Integer.toHexString) seperately. combinedly etc in various orders, but could not generate the b10a8db164e0754105b7a99be72e3fe5 digest in java. Probabvly I need to know more on MD5
Can you help me through some comments? My idea is just to generate b10a8db164e0754105b7a99be72e3fe5 from "Hello World" using MD5 digest in Java.
[fixed the width of the code example - Ilja]
[ May 11, 2004: Message edited by: Ilja Preuss ]