java.lang.Object
org.seppiko.commons.utils.codec.Base36
Base36
A simple base36 encode / decode.
Commonly used by URL redirection systems like TinyURL as
compact alphanumeric identifiers.
- Author:
- Leonard Woo
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegerDecode Base36 string to numberstatic byte[]decodeBytes(String str) Decode Base36 string to bytesstatic Stringencode(BigInteger source) Encode number to Base36 stringstatic Stringencode(BigInteger source, boolean toLowercase) Encode number to Base36 stringstatic StringencodeBytes(byte[] data) Encode bytes to Base36 stringstatic StringencodeBytes(byte[] data, boolean toLowercase) Encode bytes to Base36 string
-
Method Details
-
encodeBytes
Encode bytes to Base36 string- Parameters:
data- bytes.- Returns:
- Base36 String.
-
encodeBytes
Encode bytes to Base36 string- Parameters:
data- bytes.toLowercase- true is return[0-9a-z], false is[0-9A-Z].- Returns:
- Base36 String.
-
encode
Encode number to Base36 string- Parameters:
source- Number.- Returns:
- Base36 String.
-
encode
Encode number to Base36 string- Parameters:
source- Number.toLowercase- true is return[0-9a-z], false is[0-9A-Z].- Returns:
- Base36 String.
-
decodeBytes
Decode Base36 string to bytes- Parameters:
str- Base36 String.- Returns:
- bytes.
-
decode
Decode Base36 string to number- Parameters:
str- Base36 String.- Returns:
- Number.
-