Bitcoin/address validation: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl}}: @hash is a terrible variable name)
m (→‎{{header|Perl}}: 'my' instead of 'our')
Line 6: Line 6:


=={{header|Perl}}==
=={{header|Perl}}==
<lang perl>our @b58 = qw{
<lang perl>my @b58 = qw{
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
A B C D E F G H J K L M N P Q R S T U V W X Y Z
A B C D E F G H J K L M N P Q R S T U V W X Y Z
a b c d e f g h i j k m n o p q r s t u v w x y z
a b c d e f g h i j k m n o p q r s t u v w x y z
};
};
our %b58 = map { $b58[$_] => $_ } 0 .. 57;
my %b58 = map { $b58[$_] => $_ } 0 .. 57;
our $b58 = qr/[@{[join '', @b58]}]/x;
my $b58 = qr/[@{[join '', @b58]}]/x;


sub decode {
sub decode {