I'm looking for a way to convert a BigInteger into a very short String (shortest possible). The conversion needs to be reversible. The security of the conversion is not a big deal in this case. Would anyone have recommendations or samples of how they would go about solving this problem?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
One easy way is to use
BigInteger.toString(Character.MAX_RADIX)
. To reverse, use the following constructor:BigInteger(String val, int radix)
.You can use a Base64 encoding. Note that this example uses Apache commons-codec:
prints: