Question

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

Was it helpful?

Solution

Ok, I felt I had to give this a shot. I translated the C# implementation from My Ten Pennies to Java, and an example and source an be downloaded from here. It's not especially good looking code, but hey - it hopefully does it's work.

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

Usage:

import se.welcomweb.utils.zbase32j;

public class TestZBase32J {

    public static void main(String ... args) {

        ZBase32j zbase = new ZBase32j();

        String message = "Hello, world!";
        String encoded = zbase.encode(message);
        System.out.println("Encoded: " + encoded);

        String decoded = zbase.decode(encoded);
        System.out.println("Decoded: " + decoded);

    }

}

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top