The Artima Developer Community
Sponsored Link

Java Buzz Forum
Java: Convert MessageDigest output to hex

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Cory Watson

Posts: 284
Nickname: gphat
Registered: Jun, 2005

Cory Watson is a Senior Developer for Magazines.com
Java: Convert MessageDigest output to hex Posted: Sep 11, 2005 4:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Cory Watson.
Original Post: Java: Convert MessageDigest output to hex
Feed Title: One Mo' Gin
Feed URL: http://www.onemogin.com/blog/feed
Feed Description: Thoughts on many things. Developer stuff, mostly.
Latest Java Buzz Posts
Latest Java Buzz Posts by Cory Watson
Latest Posts From One Mo' Gin

Advertisement
Tested this and it’s compatible with Perl’s Digest::MD5: StringBuilder hexString = new StringBuilder(); byte[] bytes = digester.digest(); for (int i=0;i < bytes.length; i++) { hexString.append(Integer.toHexString((bytes[i] >>> 4) & 0×0F)); hexString.append(Integer.toHexString(0×0F & bytes[i])); } // hexString.toString() will give you your hex string!

Read: Java: Convert MessageDigest output to hex

Topic: Google Sidebar Displays Spam Previous Topic   Next Topic Topic: Hardcoded Class Names

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use