com.google.bitcoin.core
Class Base58
java.lang.Object
com.google.bitcoin.core.Base58
public class Base58
- extends Object
A custom form of base58 is used to encode BitCoin addresses. Note that this is not the same base58 as used by
Flickr, which you may see reference to around the internet.
Satoshi says: why base-58 instead of standard base-64 encoding?
- Don't want 0OIl characters that look the same in some fonts and
could be used to create visually identical looking account numbers.
- A string with non-alphanumeric characters is not as easily accepted as an account number.
- E-mail usually won't line-break if there's no punctuation to break at.
- Doubleclicking selects the whole number as one word if it's all alphanumeric.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Base58
public Base58()
encode
public static String encode(byte[] input)
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 © 2011. All Rights Reserved.