hudi hudi - 6 months ago 44
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


Have a look at Commons Codec :

byte[] decodedHex = Hex.decodeHex(hex);
byte[] encodedHexB64 = Base64.codeBase64(decodedHex);