commit for archiving
This commit is contained in:
13
Perl/bin/encode-base64
Normal file
13
Perl/bin/encode-base64
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use MIME::Base64 qw(encode_base64);
|
||||
|
||||
my $buf = "";
|
||||
while (<>) {
|
||||
$buf .= $_;
|
||||
if (length($buf) >= 57) {
|
||||
print encode_base64(substr($buf, 0, int(length($buf) / 57) * 57, ""));
|
||||
}
|
||||
}
|
||||
|
||||
print encode_base64($buf);
|
||||
Reference in New Issue
Block a user