Expand description
Multipart filename extension peeling, format candidate chain derivation, and format chain specification formatting.
Structs§
- Format
Chain - Represents a structured chain of format layers parsed from a multipart filename (e.g. .html.gz).
- Probable
Format Chain - 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_layersand total Cartesian combinations toMAX_FORMAT_CHAINS_LIMIT. - parse_
format_ chain - Parses a filename or path into a single structured
FormatChain.