Encodings
uuencode
Unix-to-Unix encoding with a begin line and length-led lines of 45 bytes. How Usenet mailed binaries
Encoding / uuencode
uuencode
How Usenet mailed binaries before MIME.
- Overhead
- +38% on random bytes
- Padding
- none
- Standard
- POSIX uuencode(1) and uudecode(1)
- Family
- 1 in uuencode
family 1 / 20
Sample
- Out
- begin 644 data↵,:&5L;&\@=V]R;&0A↵`↵end
- Back
- "hello world!" · mode 644, name data
`!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
Options
Access
- Import
import { uuencode } from "@agntn/encodings/uuencode" - CLI
encodings encode uuencode 'hello world!' - Tryplayground with the sample above
Before MIME, this is how you mailed a binary. First a begin line with the mode and the file name. Then lines of up to 45 bytes. Each one starts with a character that says how many.
encode("uuencode", "Cat", { name: "cat.txt" });
// "begin 644 cat.txt\n#0V%T\n`\nend\n"
# means three bytes, 0V%T are those three bytes. The lone backtick is an empty line, then end. Why a backtick for zero and not a space? So no mail server eats it as trailing whitespace. Smart, for 1980.
Decoding takes the text with or without the frame. A begin-base64 file is base64 wearing a uuencode hat, and it's refused as such.