Skip to main content

Module extract

Module extract 

Source
Expand description

CRC-verified zip extraction primitives. Generic, CRC-verified zip extraction primitives.

These are the reusable archive operations shared by every Thunderstore mod manager: extracting a package zip with per-entry CRC32 verification and path-traversal protection, deciding whether a downloaded version differs from what is already on disk, and parsing the Owner-Name-Version.zip filename convention. Where the extracted files ultimately land is install policy and lives in the caller (see crate::install).

Structs§

ExtractLimits
Resource limits enforced while extracting an archive, to defend against decompression bombs (an archive that is small on disk but expands to an enormous number of entries or bytes).

Functions§

extract_zip
Extracts a zip archive to dest_dir with per-entry CRC32 verification and the default ExtractLimits.
extract_zip_with_limits
Extracts a zip archive to dest_dir with per-entry CRC32 verification, enforcing the supplied ExtractLimits to defend against decompression bombs.
parse_package_filename
Parses a Thunderstore package zip filename of the form Owner-Name-Version.zip.
should_extract
Determines whether a mod should be (re)extracted based on version comparison.