File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to generate MD5 hash?

 
M K Rayapudi
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using the following code to generate MD5 hash

Is this correct or not? (Why I am asking like this is because, sites like are showing a different hash)
What is wrong in my code?

Thank you.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does that site also use the UTF-32 encoding? MD5 predates Unicode, so that seems unlikely.

Furthermore, the digest is ASCII - no base64 encoding is necessary, so that site most likely doesn't do that.
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I'll just give you sample code, you study it by your own:
 
M K Rayapudi
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Dittmer & Zandis.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic