Module chain

Module chain 

Source
Expand description

Multipart filename extension peeling, format candidate chain derivation, and format chain specification formatting.

Structs§

FormatChain
Represents a structured chain of format layers parsed from a multipart filename (e.g. .html.gz).
ProbableFormatChain
Represents a candidate chain of format layers with associated likelihood score.

Constants§

DEFAULT_MAX_CHAIN_LAYERS
Default maximum number of extension layers to peel from a filename. Aligned with DEFAULT_MAX_DECOMPRESSION_DEPTH + 1 (1 payload + 3 container layers).
MAX_FORMAT_CHAINS_LIMIT
Hard upper ceiling on candidate format chains generated from Cartesian products to protect against exponential memory and CPU consumption on crafted inputs.

Functions§

guess_format_chains
Parses a filename or path into candidate format chains, branching on ambiguous extensions and peeling recognized extension layers up to DEFAULT_MAX_CHAIN_LAYERS.
guess_format_chains_bounded
Parses a filename or path into candidate format chains, bounding peeled extension layers to max_layers and total Cartesian combinations to MAX_FORMAT_CHAINS_LIMIT.
parse_format_chain
Parses a filename or path into a single structured FormatChain.