com.google.bitcoin.core
Class Base58

java.lang.Object
  extended by com.google.bitcoin.core.Base58

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?


Field Summary
static char[] ALPHABET
           
 
Constructor Summary
Base58()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHABET

public static final char[] ALPHABET
Constructor Detail

Base58

public Base58()
Method Detail

encode

public static String encode(byte[] input)
Encodes the given bytes in base58. No checksum is appended.


decode

public static byte[] decode(String input)
                     throws AddressFormatException
Throws:
AddressFormatException

decodeToBigInteger

public static BigInteger decodeToBigInteger(String input)
                                     throws AddressFormatException
Throws:
AddressFormatException

decodeChecked

public static byte[] decodeChecked(String input)
                            throws AddressFormatException
Uses the checksum in the last 4 bytes of the decoded data to verify the rest are correct. The checksum is removed from the returned data.

Throws:
AddressFormatException - if the input is not base 58 or the checksum does not validate.


Copyright © 2014. All rights reserved.