org.weborganic.bastille.util
Class Base32

java.lang.Object
  extended by org.weborganic.bastille.util.Base32

public final class Base32
extends Object

A Base32 implementation which encodes and decodes according to RFC3548's Base32.

This class is a slightly modified version of code originally written by Robert Kaye and Gordon Mohr which is now in the public domain.

See Also:
RFC 3568 - The Base16, Base32, and Base64 Data Encodings

Method Summary
static byte[] decode(String base32)
          Decodes the given Base32 String to a raw byte array.
static String encode(byte[] bytes)
          Encodes byte array to Base32 String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static String encode(byte[] bytes)
Encodes byte array to Base32 String.

Parameters:
bytes - Bytes to encode.
Returns:
Encoded byte array bytes as a String.

decode

public static byte[] decode(String base32)
Decodes the given Base32 String to a raw byte array.

Parameters:
base32 - A string encoded as base32.
Returns:
Decoded base32 String as a raw byte array.