Tutorial :Java z-base-32 encoding algorithm



Question:

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


Solution:1

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);        }    }  


Solution:2

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »