tags:

views:

187

answers:

2

I'm searching for an implementation of z-base-32 enc algo in java, any suggestions? (encoding and decoding)

A: 

I didn't compare but it looks like the Base32 we use here. Here is the original code,

http://svn.savannah.gnu.org/svn/ccrtp/tags/release-ccrtp-1.7.0/contributions/ZRTP4J/src/gnu/java/zrtp/utils/Base32.java

ZZ Coder
A: 

Ok, I felt I had to give this a shot. I translated the C# implementation from My Ten Pennies to Java, and the result can be viewed online at pastebin.org - or you can download the .java-file from here. It's not especially good looking code, but hey - it hopefully does it work.

I haven't had time to test it thoroughly, but my short tests work fine.

Usage:

ZBase32 z      = new ZBase32();
String text    = "Your text goes here";

String encoded = z.encode(s);
/* encoded == mfzzkhtyqt1zo7byc7zskh3ypb1zr3e= */

String result  = z.decode(encoded);
/* result == Your text goes here */
Björn