uuencoding-multi
Multi-part UUencoded Usenet/email post reassembly.
Multi-part UUencoding was the standard way to post binary files to Usenet before MIME.
A large file was split into numbered parts, each posted as a separate message with a
subject line like filename.tar.gz (03/17). This crate reassembles those parts.
Depends on the uuencoding crate for decoding
individual parts.
Features
- Parse 5 real-world subject line formats to extract part number and total
- Accumulate parts via
PartCollectionwith gap detection andis_complete()check - Best-effort TOC (table-of-contents) parsing for part-0 summary posts
reassemble()— decode each part and concatenate into the original file bytes- Partial reassembly when parts are missing (
is_truncatedflag,missing_partslist) - No panics on any input
- No unsafe code
- MSRV: 1.75
Quick start
use ;
// Step 1: parse subject lines to identify part number and grouping key
let sp = parse_subject.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
// Step 2: collect parts (body_bytes is the raw UU-encoded message body)
let mut coll = with_total;
coll.add.unwrap;
coll.add.unwrap;
coll.add.unwrap;
// Step 3: reassemble when complete
if coll.is_complete
Subject line formats supported
| Format | Example |
|---|---|
| Parenthesized fraction | filename.tar.gz (03/17) |
| Bracketed fraction | filename.tar.gz [03/17] |
| English Part N/M | filename.zip Part 3/17 |
| English Part N of M | filename.zip Part 03 of 17 |
| Dash-separated | filename.zip - 03/17 |
Re: and Fwd: prefixes are stripped before matching. yEnc subjects return None
(distinct encoding, out of scope for this crate).
Partial reassembly
When parts are missing, reassemble() still returns Ok rather than an error:
let file = reassemble.unwrap;
if file.is_truncated
Error types
Security
Reassembled data is raw bytes which may be a compressed archive. Any decompression
is the caller's responsibility and must be independently guarded against decompression
bombs. This crate does not decompress.
License
MIT OR Apache-2.0