File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Hex binary to Base64 and vice versa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hex binary to Base64 and vice versa" Watch "Hex binary to Base64 and vice versa" New topic

Hex binary to Base64 and vice versa

Anup Bansal
Ranch Hand

Joined: Sep 12, 2006
Posts: 69
Hi All,

I am currently working on a project that requires conversion of Hex binary fingerprint to a Base64 encoded fingerprint and vice vesra.

e.g. Hex binary format: c88266d6581aab3e357342ae7c9c4c87a08a4a0f
Base 64 encoded: yIJm1lgaqz41c0KufJxMh6CKSg8=

Can anyone please help me with the code/ logic that would help me achieve my requirement?

Thanks in advance,
Joanne Neal

Joined: Aug 05, 2005
Posts: 3165
Do you want to actually write a Base64 Encoder/Decoder or are you happy to use an existing one ?
If the latter, then read this for a way to do it with the standard API. There are also 3rd party APIs available that are probably easier to use. Search this forum and/or Google. I've seen the one from SourceForge get mentioned quite often, but haven't actually used it myself.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39541
The Jakarta Commons Codec library can perform base64-encoding/decoding.

Ping & DNS - updated with new look and Ping home screen widget
Anup Bansal
Ranch Hand

Joined: Sep 12, 2006
Posts: 69
Hi Joanne / Ulf,

Thanks for your suggestions and inputs.
I used the Jakarta commons codec libarary to solve my problem.

Thanks & regards,
Consider Paul's rocket mass heater.
subject: Hex binary to Base64 and vice versa
Similar Threads
**Retrieve jpeg from XML file.
Password Encryption using java
Base64 format to binary converter ?
How to encrypt and Decrypt form parameters?
Display image from the binary data in form of String in a JSP