hudi hudi - 1 year ago 134
Java Question

how to convert hex to base64

how to convert hex string into base64 ? I found this page but I need some function in java:

String base64 = ...decoder(String hex);
I found something in the Internet but they are to difficult and use byte array. I am looking for something simplier
thx a lot

Answer Source

Have a look at Commons Codec :

byte[] decodedHex = Hex.decodeHex(hex);
byte[] encodedHexB64 = Base64.codeBase64(decodedHex);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download