Win a copy of Functional Reactive Programming this week in the Other Languages 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