| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MIME::Base64; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
11553
|
use strict; |
|
|
5
|
|
|
|
|
28
|
|
|
|
5
|
|
|
|
|
148
|
|
|
4
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
|
5
|
|
|
|
|
11
|
|
|
|
5
|
|
|
|
|
1346
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
|
7
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
|
8
|
|
|
|
|
|
|
our @EXPORT = qw(encode_base64 decode_base64); |
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '3.16'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
require XSLoader; |
|
14
|
|
|
|
|
|
|
XSLoader::load('MIME::Base64', $VERSION); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
*encode = \&encode_base64; |
|
17
|
|
|
|
|
|
|
*decode = \&decode_base64; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub encode_base64url { |
|
20
|
7
|
|
|
7
|
1
|
22
|
my $e = encode_base64(shift, ""); |
|
21
|
7
|
|
|
|
|
56
|
$e =~ s/=+\z//; |
|
22
|
7
|
|
|
|
|
13
|
$e =~ tr[+/][-_]; |
|
23
|
7
|
|
|
|
|
21
|
return $e; |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub decode_base64url { |
|
27
|
7
|
|
|
7
|
1
|
764
|
my $s = shift; |
|
28
|
7
|
|
|
|
|
14
|
$s =~ tr[-_][+/]; |
|
29
|
7
|
|
|
|
|
26
|
$s .= '=' while length($s) % 4; |
|
30
|
7
|
|
|
|
|
30
|
return decode_base64($s); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |