Base58 Is Base64 for Humans

3226 days ago, 0 views.

I discovered it reading the spanish version of the Wikipedia bitcoin entry.

Basically is base64 but avoiding the confuse characters:

When use it

First, the method is well-suited to encode large integers, but not designed to encode longer portions of binary data.

On the other hand, remember that Base64/58 is not a criptography algorithm: It was created simply to encoding binary-to-text and basically is the only way to send binary data in protocols that doesn’t support binary data in the transport, for example, emails protocols such as IMAP, POP3 or SMTP.

But, such as Bitcoin protocol, we can use it for other controlled actions.

For example, 6857269519 becomes brXijP in Base58 encoded. It’s basically the way how flickr create urls shortcuts (http://flic.kr/p/brXijP).

If we suppose that each number from 0 to 6857269519 is an unique id associated with each image hosted in Flickr, we have a good incremental system to get a shortcut url from image id!

Bonus: Emoji!

I created a encode-base58 to encode an string into a base58, also providing a emoji-like output:

const encodeBase58 = require('encode-base58') encodeBase58(9); // => 'a' encodeBase58.emoji(9); // => '🔆'
Kiko Beats

Kiko Beats