| 1 | package MIME::Base64; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | require Exporter; | |||||||||
| 7 | 4 | @ISA = qw(Exporter); | |||||||||
| 8 | 4 | @EXPORT = qw(encode_base64 decode_base64); | |||||||||
| 9 | 4 | @EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length); | |||||||||
| 10 | |||||||||||
| 11 | 4 | $VERSION = '3.15'; | |||||||||
| 12 | |||||||||||
| 13 | 4 | require XSLoader; | |||||||||
| 14 | 4 | XSLoader::load('MIME::Base64', $VERSION); | |||||||||
| 15 | |||||||||||
| 16 | 4 | *encode = \&encode_base64; | |||||||||
| 17 | 4 | *decode = \&decode_base64; | |||||||||
| 18 | |||||||||||
| 19 | sub encode_base64url { | ||||||||||
| 20 | 0 | ▶ | my $e = encode_base64(shift, ""); | ||||||||
|
Subroutine
encode_base64url: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 21 | 0 | $e =~ s/=+\z//; | |||||||||
| 22 | 0 | $e =~ tr[+/][-_]; | |||||||||
| 23 | 0 | return $e; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | sub decode_base64url { | ||||||||||
| 27 | 0 | ▶ | my $s = shift; | ||||||||
|
Subroutine
decode_base64url: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 28 | 0 | $s =~ tr[-_][+/]; | |||||||||
| 29 | 0 | ▶ | $s .= '=' while length($s) % 4; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | return decode_base64($s); | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 4 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||