Anonymous user
Bitcoin/public point to address: Difference between revisions
→{{header|Perl}}: longer pipeline and a final unpack
(→{{header|Perl}}: longer pipeline and a final unpack) |
|||
Line 306:
sub public_point_to_address {
my $ec = join '
my
my $hash = chr(0) . Crypt::RIPEMD160->hash(sha256 $octets); # perform RIPEMD160(SHA256(octets)
my $checksum = substr sha256(sha256 $hash), 0, 4; # build the checksum
my $hex = join '
map { sprintf
return '1' . sprintf "%32s", encode_base58($hex, 'bitcoin'); # Do the Base58 encoding, prepend "1"
}
|