This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Digest different on JDK1.4 and 1.5

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.security.MessageDigest digest = MessageDigest.getInstance( "SHA-1" );
digest.reset();
byte[] value = digest.digest("password".getBytes());

The value of digest is different from JDK 1.4 and 1.5, even when running on the same PC and having the same charset.

Did I miss anything? How can I get the same value?

Thanks,
Yan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic