Jodd is an open-source java library with lot of reusable components and feature rich utilities. This requires the library jodd-3.3.2.jar to be in classpath. The following example shows how to use Base32.encode() and Base32.decode() APIs.
package com.bethecoder.tutorials.jodd.encode; import jodd.util.Base32; public class Base32Test { /** * @param args */ public static void main(String[] args) { String str = "BE THE CODER"; String encoded = Base32.encode(str.getBytes()); System.out.println(encoded); byte [] decoded = Base32.decode(encoded); System.out.println(new String(decoded)); str = "My test message"; encoded = Base32.encode(str.getBytes()); System.out.println(encoded); decoded = Base32.decode(encoded); System.out.println(new String(decoded)); } }
IJCSAVCIIUQEGT2EIVJA BE THE CODER JV4SA5DFON2CA3LFONZWCZ3F My test message