Base58 encoding and decoding for Bitcoin and Flickr