mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-12 10:03:51 +00:00
* craft-zip: ZIP preflight, bounded entry read and Budget (from craft-archive, #129) The ZIP half of the craft-archive proposal (#126, #129): an allocation-free check of the end records and central directory that runs before a ZIP reader indexes the archive, a bounded entry read that distrusts the declared size, and the named Budget both charge. The XML half of #129 is not carried: craft-xml bounds XML now. * craft-zip: Archive (entry-count guard, duplicate names, budgeted reads) and Writer check_entry_count is craft-opc's guard: the declared entry count, ZIP64 included, checked on the raw bytes before zip parses the central directory. Archive reads entries within a per-entry limit and a total Budget through read_entry. Duplicate names are found by counting the central directory headers against the entries zip kept. Writer is craft-opc's ZipOut: stored or deflated entries, ZIP64 for large ones, one fixed timestamp. * craft-idml, craft-epub: read and write through craft-zip Both crates drop their own bounded ZIP reads and zip writers. They gain the entry-count check before the archive is indexed (ZIP64 included) and archives whose bytes depend only on their content (one fixed timestamp). --------- Co-authored-by: skylar taylor-barrick <hi@skylar.cc>
22 lines
733 B
TOML
22 lines
733 B
TOML
[package]
|
|
name = "craft-epub"
|
|
description = "EPUB packages: the OCF ZIP container, the package document (manifest, spine, metadata) and the navigation document, written (EPUB 3, reflowable and fixed layout) and read (EPUB 2 and 3) with bounded reads."
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
craft-xml = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
craft-zip = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
# The tests build hostile archives by hand.
|
|
zip = { version = "9", default-features = false, features = ["deflate-flate2"] }
|
|
craft-zip = { workspace = true, features = ["test-support"] }
|