Base58Check encoding

From Rosetta Code
Revision as of 09:12, 13 July 2017 by rosettacode>Krauss (first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


The popular enconding of litle checksums is base16, that is more compact tham usual base10 and is human readable... For checksums resulting in hash digests bigger tham ~100 bits, the base16 is too long: base58 is shorter and (as Bitcoin-alphabet-base58) preserves secure human readability. The most popular alphabet of base58 is the used in bitcoin address (see Bitcoin/address validation), so it is the "default base58 alphabet".

Write a program that takes a checksum (resultant hash digest) integer binary representation as argument, and converts (encode it) into base58 with the standard Bitcoin alphabet — which uses an alphabet of the characters 0 .. 9, A ..Z, a .. z, but without the four characters 0, O, I and l.