org.ceryle.util
Class Base64Converter

java.lang.Object
  extended by org.ceryle.util.Base64Converter

public class Base64Converter
extends Object

A utility class that converts a long to an base 64 number (returned as a String). The hashCode() of a String is a long; each long has a unique base 64 conversion.

This is compatible with the "URL and Filename safe" Base 64 alphabet, Table 2 of RFC 3548 (notably not compatible with the last two characters of PEM or MIME); also see Wikipedia's Base 64 page. This uses A-Z, a-z, 0-9, '-' and '_' as the encoding scheme.

Since:
JDK1.4.2
Version:
$Id: Base64Converter.java,v 3.1 2007-06-15 12:09:55 altheim Exp $
Author:
Murray Altheim

Constructor Summary
Base64Converter()
           
 
Method Summary
static String toBase64(long l)
          Convert the long l to an base 64 number (returned as a String).
static String toBase64(String s)
          Convert the String s to an base 64 number (returned as a String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64Converter

public Base64Converter()
Method Detail

toBase64

public static String toBase64(String s)
Convert the String s to an base 64 number (returned as a String). The hashCode() of a String is a long; its base 64 conversion is unique.

This is a convenience method that passes a hash of the String through toBase64(long).


toBase64

public static String toBase64(long l)
Convert the long l to an base 64 number (returned as a String). The hashCode() of a String is a long; its base 64 conversion is unique.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.