Filename | /usr/lib/x86_64-linux-gnu/perl/5.20/MIME/Base64.pm |
Statements | Executed 14 statements in 368µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 12µs | 23µs | BEGIN@3 | MIME::Base64::
1 | 1 | 1 | 7µs | 45µs | BEGIN@4 | MIME::Base64::
0 | 0 | 0 | 0s | 0s | decode_base64url | MIME::Base64::
0 | 0 | 0 | 0s | 0s | encode_base64url | MIME::Base64::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package MIME::Base64; | ||||
2 | |||||
3 | 2 | 26µs | 2 | 34µs | # spent 23µs (12+11) within MIME::Base64::BEGIN@3 which was called:
# once (12µs+11µs) by C4::Letters::BEGIN@23 at line 3 # spent 23µs making 1 call to MIME::Base64::BEGIN@3
# spent 11µs making 1 call to strict::import |
4 | 2 | 151µs | 2 | 83µs | # spent 45µs (7+38) within MIME::Base64::BEGIN@4 which was called:
# once (7µs+38µs) by C4::Letters::BEGIN@23 at line 4 # spent 45µs making 1 call to MIME::Base64::BEGIN@4
# spent 38µs making 1 call to vars::import |
5 | |||||
6 | 1 | 600ns | require Exporter; | ||
7 | 1 | 6µs | @ISA = qw(Exporter); | ||
8 | 1 | 600ns | @EXPORT = qw(encode_base64 decode_base64); | ||
9 | 1 | 400ns | @EXPORT_OK = qw(encode_base64url decode_base64url encoded_base64_length decoded_base64_length); | ||
10 | |||||
11 | 1 | 100ns | $VERSION = '3.14'; | ||
12 | |||||
13 | 1 | 1µs | require XSLoader; | ||
14 | 1 | 176µs | 1 | 169µs | XSLoader::load('MIME::Base64', $VERSION); # spent 169µs making 1 call to XSLoader::load |
15 | |||||
16 | 1 | 900ns | *encode = \&encode_base64; | ||
17 | 1 | 200ns | *decode = \&decode_base64; | ||
18 | |||||
19 | sub encode_base64url { | ||||
20 | my $e = encode_base64(shift, ""); | ||||
21 | $e =~ s/=+\z//; | ||||
22 | $e =~ tr[+/][-_]; | ||||
23 | return $e; | ||||
24 | } | ||||
25 | |||||
26 | sub decode_base64url { | ||||
27 | my $s = shift; | ||||
28 | $s =~ tr[-_][+/]; | ||||
29 | $s .= '=' while length($s) % 4; | ||||
30 | return decode_base64($s); | ||||
31 | } | ||||
32 | |||||
33 | 1 | 5µs | 1; | ||
34 | |||||
35 | __END__ |