Base64.pm

filter: Statementstmt 100% 2 / 2 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 2 / 2 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« QuotedPrint.pm ↑ Summary
1 package SPVM::MIME::Base64;
2  
3 1 our $VERSION = "1.009";
4  
5 1 1;
6  
7 =head1 Name
8  
9 SPVM::MIME::Base64 - Base64 Encoding/Decoding
10  
11 =head1 Description
12  
13 MIME::Base64 class in L<SPVM> provides L<Base64|https://en.wikipedia.org/wiki/Base64> encoding/decoding.
14  
15 =head1 Usage
16  
17 use MIME::Base64;
18
19 my $encoded = MIME::Base64->encode_base64('Aladdin:open sesame');
20 my $decoded = MIME::Base64->decode_base64($encoded);
21  
22 =head1 Class Methods
23  
24 =head2 encode_base64
25  
26 C<static method encode_base64 : string ($string : string, $eol : string = undef);>
27  
28 Encodes the string $string to a Base64 string, and returns it.
29  
30 The argument $eol is the line-ending sequence to use. It is optional and defaults to C<\n>.
31  
32 The returned encoded string is broken into lines of no more than 76
33 characters each and it will end with $eol unless it is empty.
34  
35 Pass an empty string as the $eol if you do not want the encoded string
36 to be broken into lines.
37  
38 Exceptions:
39  
40 $string must be defined. Otherwise an exception is thrown.
41  
42 =head2 decode_base64
43  
44 C<static method decode_base64 : string ($string : string);>
45  
46 Decodes a Base64 string $string to a string, and returns it.
47  
48 Any character not part of the 65-character base64 subset is
49 silently ignored. Characters occurring after a C<=> padding character
50 are never decoded.
51  
52 Exceptions:
53  
54 $string must be defined. Otherwise an exception is thrown.
55  
56 =head2 encoded_base64_length
57  
58 C<static method encoded_base64_length : int ($string : string, $eol : string = undef);>
59  
60 Returns the length that the encoded string would have without actually
61 encoding it.
62  
63 This will return the same value as the length of the returned value of the L</"encode_base64"> method,
64 but should be more efficient.
65  
66 Exceptions:
67  
68 $string must be defined. Otherwise an exception is thrown.
69  
70 =head2 decoded_base64_length
71  
72 C<static method decoded_base64_length : int ($string : string);>
73  
74 Returns the length that the decoded string would have without actually
75 decoding it.
76  
77 This will return the same value as the length of the returned value of the L</"decode_base64"> method,
78 but should be more efficient.
79  
80 Exceptions:
81  
82 $string must be defined. Otherwise an exception is thrown.
83  
84 =head1 Other Modules in This Distribution
85  
86 =over 2
87  
88 =item * L<SPVM::MIME::QuotedPrint>
89  
90 =back
91  
92 =head1 See Also
93  
94 =over 2
95  
96 =item * L<MIME::QuotedPrint> - SPVM::MIME::QuotedPrint is a MIME::QuotedPrint porting to SPVM
97  
98 =back
99  
100 =head1 Repository
101  
102 L<SPVM::MIME::Base64 - Github|https://github.com/yuki-kimoto/SPVM-MIME-Base64>
103  
104 =head1 Author
105  
106 Yuki Kimoto (kimoto.yuki@gmail.com)
107  
108 =head1 Contributors
109  
110 L<Yoshiyuki Ito|https://github.com/YoshiyukiItoh>
111  
112 =head1 Copyright & License
113  
114 Copyright (c) 2023 Yuki Kimoto
115  
116 MIT License
« QuotedPrint.pm ↑ Summary