Encode-Base58

 view release on metacpan or  search on metacpan

lib/Encode/Base58.pm  view on Meta::CPAN

        $num = int($num / $base);
        $res = $alpha[$remain] . $res;
    }

    return $res;
}

sub decode_base58 {
    my $str = shift;

    my $decoded = 0;
    my $multi   = 1;
    my $base    = @alpha;

    while (length $str > 0) {
        my $digit = chop $str;
        $decoded += $multi * $alpha{$digit};
        $multi   *= $base;
    }

    return $decoded;
}

1;
__END__

=encoding utf-8

=for stopwords
Flickr Flickr's



( run in 0.327 second using v1.01-cache-2.11-cpan-0d8aa00de5b )