The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CryptoTron::AddrTools - Perl extension for use with crypto coin Tron addresses

SYNOPSIS

  use CryptoTron::AddrTools;

  # Declare the public keys.
  my $PublicKeyBase58 = 'TQHgMpVzWkhSsRB4BzZgmV8uW4cFL8eaBr';
  my $PublicKeyHex = '419D1015E669C2DF831003C5C54CEB48DA613D9979';

  # Convert the public keys.
  my $HexAddr = to_hex_addr($PublicKeyBase58);
  print $HexAddr . "\n";
  my $Base58Addr = to_base58_addr($PublicKeyHex);
  print $Base58Addr . "\n";

  # Check the public keys.
  my $chkBase58Addr = chk_base58_addr($PublicKeyBase58);
  print $chkBase58Addr . "\n";
  my $chkHexAddr = chk_hex_addr($PublicKeyHex);
  print $chkHexAddr . "\n";

DESCRIPTION

The package is intended to simplify the work with addresses of the crypto coin Tron. There are two types of Tron addresse usable, one in Base58 and one in Hex represenation.

Method to_hex_addr() converts a Base58 address to a Hex address.

Method to_base58_addr() converts a Hex address to a Base58 address.

The methods chk_base58_addr() and chk_hex_addr return 0 (false) or 1 (true), depending on valid Base58 or Hex addresses.

SEE ALSO

Bitcoin::Crypto::Base58

AUTHOR

Dr. Peter Netz, <ztenretep@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2022 by Dr. Peter Netz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.30.0 or, at your option, any later version of Perl 5 you may have available.