aspose file tools
The moose likes Java in General and the fly likes SHA output different for Java and for MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "SHA output different for Java and for MySQL" Watch "SHA output different for Java and for MySQL" New topic
Author

SHA output different for Java and for MySQL

Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 122
Greetings all,

This code


yields


but in MySQL 5.0.51a

yields


what do I need to do to get my Java code's result to match what MySQL generates?


TIA,

Still-learning Steve
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You're doing an update and a digest with the same value. So you're adding it twice. Just remove the update.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 122
D-oH! Serves me right for trying to code at 02:45 . Yes you are absolutely correct.

CASE CLOSED

Thanks!

Still-learning-and-sleepy Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SHA output different for Java and for MySQL
 
Similar Threads
Book Promotion : Hacking Exposed: J2EE and Java
How to convert MessageDigest object to string?
How to store a MessageDigest object in Oracle Database
generate Unique key
need decrypt method