Package com.bisna.util
Class Base62
- java.lang.Object
-
- com.bisna.util.Base62
-
public class Base62 extends Object
A Base62 encoder/decoder.- Author:
- Sebastian Ruhleder, sebastian@seruco.io, Guilherme Blanco, guilhermeblanco@gmail.com
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Base62createInstance()Creates aBase62instance.static Base62createInstanceWithGmpCharacterSet()Creates aBase62instance using the GMP-style character set.static Base62createInstanceWithInvertedCharacterSet()Creates aBase62instance using the inverted character set.byte[]decode(byte[] encoded)Decodes a sequence of Base62-encoded bytes.byte[]encode(byte[] message)Encodes a sequence of bytes in Base62 encoding.
-
-
-
Method Detail
-
createInstance
public static Base62 createInstance()
Creates aBase62instance. Defaults to the GMP-style character set.- Returns:
- a
Base62instance.
-
createInstanceWithGmpCharacterSet
public static Base62 createInstanceWithGmpCharacterSet()
Creates aBase62instance using the GMP-style character set.- Returns:
- a
Base62instance.
-
createInstanceWithInvertedCharacterSet
public static Base62 createInstanceWithInvertedCharacterSet()
Creates aBase62instance using the inverted character set.- Returns:
- a
Base62instance.
-
encode
public byte[] encode(byte[] message)
Encodes a sequence of bytes in Base62 encoding.- Parameters:
message- a byte sequence.- Returns:
- a sequence of Base62-encoded bytes.
-
decode
public byte[] decode(byte[] encoded)
Decodes a sequence of Base62-encoded bytes.- Parameters:
encoded- a sequence of Base62-encoded bytes.- Returns:
- a byte sequence.
-
-