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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
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: 140
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: 140
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