uuencoding 0.1.0

UUencoding and UUdecoding — encode, decode, and scan for UU blocks
Documentation
  • Coverage
  • 86.67%
    26 out of 30 items documented4 out of 8 items with examples
  • Size
  • Source code size: 64.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 648.11 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • MarkAtwood/crate-mime
    0 0 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MarkAtwood

uuencoding

UUencoding and UUdecoding for Rust — encode, decode, and scan for UU blocks.

UUencoding is a binary-to-text encoding from the UUCP/Usenet era (1980s). It appears in email as Content-Transfer-Encoding: x-uuencode and as inline begin/end blocks embedded in text/plain message bodies.

Features

  • encode(data, filename, mode) — produce a well-formed begin/end UU block
  • decode(input) — decode a full UU block including begin/end framing
  • scan(input) — find all UU blocks by byte offset in arbitrary text (inline use case)
  • Handles real-world noise: CRLF line endings, trailing-space stripping by mail relays, space/backtick ambiguity for zero, missing end lines, begin-base64 detection
  • No panics on any input
  • No unsafe code
  • MSRV: 1.75

Usage

use uuencoding::{encode, decode, scan};

// Encode
let encoded = encode(b"Hello, World!", "hello.txt", 0o644);

// Decode
let block = decode(&encoded).unwrap();
assert_eq!(block.data, b"Hello, World!");
assert_eq!(block.metadata.filename, "hello.txt");

// Scan for inline blocks
for result in scan(&encoded) {
    let block = result.unwrap();
    println!("found block at {}..{}", block.begin_offset, block.end_offset);
}

Security

Decoded output can be significantly larger than encoded input. If the decoded bytes are a compressed archive, any decompression is the caller's responsibility and must be independently guarded against decompression bombs.

License

MIT OR Apache-2.0