public class Base58 extends Object
Base58 is a way to encode Bitcoin addresses as numbers and letters. Note that this is not the same base58 as used by Flickr, which you may see reference to around the internet.
You may instead wish to work with VersionedChecksummedBytes
, which adds support for testing the prefix
and suffix bytes commonly found in addresses.
Satoshi says: why base-58 instead of standard base-64 encoding?
Modifier and Type | Field and Description |
---|---|
static char[] |
ALPHABET |
Constructor and Description |
---|
Base58() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(String input) |
static byte[] |
decodeChecked(String input)
Uses the checksum in the last 4 bytes of the decoded data to verify the rest are correct.
|
static BigInteger |
decodeToBigInteger(String input) |
static String |
encode(byte[] input)
Encodes the given bytes in base58.
|
public static String encode(byte[] input)
public static byte[] decode(String input) throws AddressFormatException
AddressFormatException
public static BigInteger decodeToBigInteger(String input) throws AddressFormatException
AddressFormatException
public static byte[] decodeChecked(String input) throws AddressFormatException
AddressFormatException
- if the input is not base 58 or the checksum does not validate.Copyright © 2014. All rights reserved.