Bitcoin::Crypto::Base58 - Bitcoin's Base58 helpers in Perl
# none exported by default use Bitcoin::Crypto::Base58 qw( encode_base58 decode_base58 encode_base58check decode_base58check ); my $b58str = encode_base58check(pack "A*", "hello"); my $bytestr = decode_base58check($b58str);
Implementation of Base58Check algorithm and alias to CryptX encode_b58b / decode_b58b
This module is based on Exporter. None of the functions are exported by default. :all tag exists that exports all the functions at once.
:all
Basic base58 encoding / decoding.
Encoding takes one argument which is byte string.
Decoding takes base58-encoded string
These two functions are just aliases to encode_b58b and decode_b58b from Crypt::Misc with some error checking.
Base58 with checksum validation. These functions are used with Bitcoin legacy / compatibility addresses.
Arguments are the same as base functions mentioned above.
Additional errors (other than illegal characters) are thrown.
This module throws an instance of Bitcoin::Crypto::Exception if it encounters an error. It can produce the following error types from the Bitcoin::Crypto::Exception namespace:
Base58InputFormat - input was not suitable for base58 operations due to invalid format
Base58InputChecksum - checksum validation has failed
To install Bitcoin::Crypto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bitcoin::Crypto
CPAN shell
perl -MCPAN -e shell install Bitcoin::Crypto
For more information on module installation, please visit the detailed CPAN module installation guide.