public class Base58
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
ALPHABET |
| Constructor and Description |
|---|
Base58() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(java.lang.String input)
Decodes the given base58 string into the original data bytes.
|
static byte[] |
decodeChecked(java.lang.String input)
Decodes the given base58 string into the original data bytes, using the checksum in the
last 4 bytes of the decoded data to verify that the rest are correct.
|
static java.math.BigInteger |
decodeToBigInteger(java.lang.String input) |
static java.lang.String |
encode(byte[] input)
Encodes the given bytes as a base58 string (no checksum is appended).
|
static java.lang.String |
encodeChecked(int version,
byte[] payload)
Encodes the given version and bytes as a base58 string.
|
public static java.lang.String encode(byte[] input)
input - the bytes to encodepublic static java.lang.String encodeChecked(int version,
byte[] payload)
version - the version to encodepayload - the bytes to encode, e.g. pubkey hashpublic static byte[] decode(java.lang.String input)
throws AddressFormatException
input - the base58-encoded string to decodeAddressFormatException - if the given string is not a valid base58 stringpublic static java.math.BigInteger decodeToBigInteger(java.lang.String input)
throws AddressFormatException
AddressFormatExceptionpublic static byte[] decodeChecked(java.lang.String input)
throws AddressFormatException
input - the base58-encoded string to decode (which should include the checksum)AddressFormatException - if the input is not base 58 or the checksum does not validate.