File: encode64.pl

package info (click to toggle)
dotlrn 2.5.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 109,504 kB
  • ctags: 21,125
  • sloc: tcl: 219,608; sql: 202,152; xml: 127,658; java: 7,268; php: 4,780; sh: 2,180; perl: 1,207; makefile: 110
file content (20 lines) | stat: -rw-r--r-- 327 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
#
# Encode a file from stdin as base64
#
# hqm@ai.mit.edu
#
# This script does the following:
#

use MIME::Base64 ();

binmode(STDIN);
binmode(STDOUT);
# Make sure to read in multiples of 6 chars, to
# keep the encoded blocks contiguous.
while (read(STDIN, $_, 60*1024)) {
  print MIME::Base64::encode($_);
}