public class Base58 extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static char[] |
ALPHABET |
| 构造器和说明 |
|---|
Base58() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decode(String input)
Decodes the given base58 string into the original data bytes.
|
static byte[] |
decodeChecked(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 BigInteger |
decodeToBigInteger(String input) |
static String |
encode(byte[] input)
Encodes the given bytes as a base58 string (no checksum is appended).
|
static String |
encodeChecked(int version,
byte[] payload)
Encodes the given version and bytes as a base58 string.
|
public static String encode(byte[] input)
input - the bytes to encodepublic static String encodeChecked(int version, byte[] payload)
version - the version to encodepayload - the bytes to encode, e.g. pubkey hashpublic static byte[] decode(String input) throws Exception
input - the base58-encoded string to decodeException - if the given string is not a valid base58 stringpublic static BigInteger decodeToBigInteger(String input) throws Exception
Exceptionpublic static byte[] decodeChecked(String input) throws Exception
input - the base58-encoded string to decode (which should include the checksum)Exception - if the input is not base 58 or the checksum does not validate.Copyright © 2020. All rights reserved.