Base58

Base58 is a way to encode Bitcoin addresses (or arbitrary data) as alphanumeric strings. <p> Note that this is not the same base58 as used by Flickr, which you may find referenced around the Internet. <p> You may want to consider working with {@link VersionedChecksummedBytes} instead, which adds support for testing the prefix and suffix bytes commonly found in addresses. <p> Satoshi explains: why base-58 instead of standard base-64 encoding? <ul> <li>Don't want 0OIl characters that look the same in some fonts and could be used to create visually identical looking account numbers.</li> <li>A string with non-alphanumeric characters is not as easily accepted as an account number.</li> <li>E-mail usually won't line-break if there's no punctuation to break at.</li> <li>Doubleclicking selects the whole number as one word if it's all alphanumeric.</li> </ul> <p> However, note that the encoding/decoding runs in O(n&sup2;) time, so it is not useful for large data. <p> The basic idea of the encoding is to treat the data bytes as a large number represented using base-256 digits, convert the number to be represented using base-58 digits, preserve the exact number of leading zeros (which are otherwise lost during the mathematical operations on the numbers), and finally represent the resulting base-58 digits as alphanumeric ASCII characters.

Members

Static functions

decode
byte[] decode(string input)

Decodes the given base58 string into the original data bytes.

decodeToBigInteger
BigInt decodeToBigInteger(string input)
Undocumented in source. Be warned that the author may not have intended to support it.
encode
string encode(byte[] inp)

Encodes the given bytes as a base58 string (no checksum is appended).

Static variables

ALPHABET
char[] ALPHABET;
Undocumented in source.

Meta