1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! StuffIt 5 **Arsenic** (compression method 15) — **decoder only**.
//!
//! Arsenic is the Burrows–Wheeler-based codec used by StuffIt 5 archives
//! (compression-method id 15). This module decodes the **raw method-15 fork
//! payload** — the bytes a StuffIt 5 container stores for a member
//! compressed with Arsenic — not the SIT container itself. It plugs in
//! behind the streaming [`crate::traits::Algorithm`] trait like the other
//! per-method codecs in this crate.
//!
//! ## Decode pipeline
//!
//! 1. A carry-less binary range/arithmetic decoder (`NUMBITS = 26`,
//! `ONE = 2^25`, `HALF = 2^24`, MSB-first bit feed) driving nine adaptive
//! frequency models recovers a stream of selector/symbol tokens.
//! 2. The tokens drive a combined un-RLE / un-MTF stage (a bijective base-2
//! zero-run scheme for runs of MTF index 0) producing one block of
//! BWT-permuted bytes.
//! 3. An inverse Burrows–Wheeler transform un-permutes the block using a
//! stored primary index.
//! 4. If the block is flagged randomized, selected byte positions are
//! XOR-corrected at spacings drawn cyclically from a fixed 256-entry
//! randomization table.
//! 5. A final "four equal bytes then count" RLE layer is expanded.
//!
//! The stream self-terminates: each block carries an end-of-blocks flag and
//! the final block is followed by a 32-bit CRC-32 trailer (poly
//! `0xEDB88320`, init `0xFFFFFFFF`, compared to the bitwise complement of
//! the running CRC over the decoded output). No out-of-band length is
//! required.
//!
//! ## Encoder
//!
//! Permanently [`Error::Unsupported`]: StuffIt 5 is a decode-only target in
//! this crate (matching LZFSE, Quantum, RAR\*, …).
//!
//! ## Tables
//!
//! The nine model parameters and the 256-entry randomization table are
//! wire-format constants required for bit-exact decoding; they are embedded
//! verbatim in [`tables`](self) from the project's maintainer-sanctioned
//! interoperability data.
extern crate alloc;
use crateError;
use crate;
pub
pub
pub
pub
pub use Decoder;
/// Zero-sized marker type implementing [`Algorithm`] for StuffIt 5 Arsenic.
;
// ─── encoder ─────────────────────────────────────────────────────────────
/// Encoder stub. StuffIt 5 Arsenic encoding is out of scope for this build;
/// every method here returns [`Error::Unsupported`].
;