Base58
Base58 is a term from the computer field and describes a method for coding positive integers. The alphabet of Base58 results from that of the Base62 coding by omitting the four characters 0 (zero), O (capital o), I (capital i) and l (small L). Compared to the alphabet of the Base64 coding, the characters + (plus) and / (slash) are also missing.
The resulting alphabet of length 58 is 123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ , so it only consists of unmistakable alpha-numeric characters.
The advantage of Base58 compared to Base62 and Base64 is that confusion between characters that look similar (0, O, o; 1, I, l) is impossible, regardless of the font used. In addition, as with Base62 (and in contrast to Base64), the use of only alpha-numeric characters (without + and /) ensures that the entire Base58 string is selected when double-clicking. For example, there is no unwanted line break in e-mails. The disadvantage is a slightly longer string than with a Base62 / Base64 encoding. In addition, two numbers that contain the same number of bits in binary representation can have different lengths in Base58 representation because 58 is not a power of two. For this reason, the Base58-encoded Bitcoin addresses can be between 25 or 27 and 34 characters long.
use
Use finds the Base58 encoding typically where long integers are to be converted into shorter strings and a confusion-free detection of address should be ensured, for example Flickr - short URLs or Bitcoin addresses.
Web links
- Exemplary PHP code for Base58 encoding and decoding
- Discussion about base58 encoded flickr short photo IDs
- Bitcoin Base58Check encoding
- Individual steps to calculate a Bitcoin address (last step is the Base58 encoding of a hex word)