| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Convert::Base64; |
|
2
|
|
|
|
|
|
|
$Convert::Base64::VERSION = '0.001'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Encoding and decoding of Base64 strings |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
677
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
38
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
28
|
|
|
7
|
1
|
|
|
1
|
|
934
|
use MIME::Base64 (); |
|
|
1
|
|
|
|
|
607
|
|
|
|
1
|
|
|
|
|
96
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
|
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
|
11
|
|
|
|
|
|
|
our @EXPORT = qw(encode_base64 decode_base64); |
|
12
|
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
0
|
|
sub encode_base64 { @_ = ($_[0], ''); goto &MIME::Base64::encode; } |
|
|
0
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
*decode_base64 = \&MIME::Base64::decode; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
1; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Convert::Base64 - Encoding and decoding of Base64 strings |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 VERSION |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
version 0.001 |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use Convert::Base64; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$encoded = encode_base64("\x3a\x27\x0f\x93"); |
|
31
|
|
|
|
|
|
|
$decoded = decode_base64($encoded); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
This module provides functions to convert strings to/from the Base64 encoding |
|
37
|
|
|
|
|
|
|
as described in RFC 4648. |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Its implemented as a light wrapper over L. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over 4 |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item * |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
C |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $encoded = encode_base64("foo"); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Encode a string of bytes into its Base64 representation. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item * |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
C |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $decoded = encode_base64("Zm9v"); |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Decode a Base64 string into a string of bytes. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=back |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over 4 |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L - the classic Base64 implementation for Perl, used internally |
|
70
|
|
|
|
|
|
|
by this module |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
L - the original inspiration for this module |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L - the Base64 specification |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SUPPORT |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Please report bugs or feature requests through the issue tracker at |
|
87
|
|
|
|
|
|
|
L. You will be notified |
|
88
|
|
|
|
|
|
|
automatically of any progress on your issue. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 Source Code |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
|
93
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
git clone https://github.com/robn/Convert-Base64.git |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHORS |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=over 4 |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Robert Norris |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=back |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Robert Norris. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
114
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |