org.iids.aos.util
Class Base32

java.lang.Object
  extended by org.iids.aos.util.Base32

public class Base32
extends java.lang.Object

Base32 - encodes and decodes 'Canonical' Base32

Author:
Robert Kaye & Gordon Mohr

Constructor Summary
Base32()
           
 
Method Summary
static byte[] decode(java.lang.String base32)
          Decode a Base32 string into an array of binary bytes.
static java.lang.String encode(byte[] bytes)
          Encode an array of binary bytes into a Base32 string.
static void main(java.lang.String[] args)
          For testing, take a command-line argument in Base32, decode, print in hex, encode, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base32

public Base32()
Method Detail

encode

public static java.lang.String encode(byte[] bytes)
Encode an array of binary bytes into a Base32 string. Should not fail (the only possible exception is that the returned string cannot be allocated in memory)


decode

public static byte[] decode(java.lang.String base32)
                     throws java.lang.IllegalArgumentException
Decode a Base32 string into an array of binary bytes. May fail if the parameter is a non canonical Base32 string (the only other possible exception is that the returned array cannot be allocated in memory)

Throws:
java.lang.IllegalArgumentException

main

public static void main(java.lang.String[] args)
For testing, take a command-line argument in Base32, decode, print in hex, encode, print



Copyright © 2003, 2004 IIDS Group. All Rights Reserved.