public class LongEncoder extends Object
0123456789ABCDEF-
can be used. Long values can be
shortened even further by using longer alphabets. The last character in the alphabet is used as
the negative sign.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT
default alphabet that should be safe to use in most circumstances, while still providing good
shortening of long values
|
Modifier and Type | Method and Description |
---|---|
static long |
decode(String value)
Decodes value using the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
static long |
decode(String value,
String alphabet)
Decodes value using the specified alphabet
|
static String |
encode(long value)
Encodes the value into the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
static String |
encode(long value,
String alphabet)
Encodes value into the specified alphabet
|
public static final String DEFAULT
public static String encode(long value)
value
- public static long decode(String value)
value
- public static String encode(long value, String alphabet)
value
- alphabet
- Copyright © 2006–2022 Apache Software Foundation. All rights reserved.