| 1 | 1 | ▶ | use strict; use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | package Convert::Base32::Crockford; | ||
| 3 | 1 | our $VERSION = '0.16'; | |
| 4 | |||
| 5 | 1 | ▶ | use Convert::Base32 (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use base 'Exporter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | our @EXPORT = qw(encode_base32 decode_base32); | |
| 9 | |||
| 10 | 5 | ▶ | sub encode_base32 { |
|
Subroutine
encode_base32: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | 5 | my $base32 = Convert::Base32::encode_base32($_[0]); | |
| 12 | 5 | $base32 =~ | |
| 13 | tr {abcdefghijklmnopqrstuvwxyz234567} | ||
| 14 | {0123456789ABCDEFGHJKMNPQRSTVWXYZ}; | ||
| 15 | 5 | return $base32; | |
| 16 | } | ||
| 17 | |||
| 18 | 20 | ▶ | sub decode_base32 { |
|
Subroutine
decode_base32: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 20 | my $string = uc($_[0]); | |
| 20 | 20 | $string =~ | |
| 21 | tr {0O1IL23456789ABCDEFGHJKMNPQRSTVWXYZ-} | ||
| 22 | {aabbbcdefghijklmnopqrstuvwxyz234567}d; | ||
| 23 | 20 | return Convert::Base32::decode_base32($string); | |
| 24 | } | ||
| 25 | |||
| 26 | 1 | 1; | |