public class Base58Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static char[] |
BASE58_CHARS |
protected static int |
CHECKSUM_LEN |
protected static char |
ENCODED_ZERO |
protected static int[] |
INDEXES |
protected static org.slf4j.Logger |
logger |
Constructor and Description |
---|
Base58Utils() |
Modifier and Type | Method and Description |
---|---|
protected static byte[] |
calculateCheckSum(byte[] rawData)
Calculate checksum with a
rawData . |
static byte[] |
decode(java.lang.String input)
Decodes the given base58 string into the original data bytes.
|
static byte[] |
decodeWithCheck(java.lang.String encoded)
Decode base58 string with checksum to byte array.
|
static java.lang.String |
encode(byte[] input)
Encodes the given bytes as a base58 string (no checksum is appended).
|
static java.lang.String |
encodeWithCheck(byte[] rawData)
Encode byte array to base58 with checksum.
|
protected static final org.slf4j.Logger logger
protected static final char[] BASE58_CHARS
protected static final char ENCODED_ZERO
protected static final int[] INDEXES
protected static final int CHECKSUM_LEN
public static java.lang.String encode(byte[] input)
input
- the bytes to encode.input
is empty or null.public static byte[] decode(java.lang.String input) throws java.io.IOException
input
- the base58-encoded string to decodeinput
is empty or null.java.io.IOException
- when decoding failedpublic static java.lang.String encodeWithCheck(byte[] rawData)
rawData
- raw byte arrayrawData
is empty or null.public static byte[] decodeWithCheck(java.lang.String encoded) throws java.io.IOException
encoded
- base58 encoded stringencoded
is empty or null.java.io.IOException
- when decoding failedprotected static byte[] calculateCheckSum(byte[] rawData)
rawData
.rawData
- raw data