we (web engine): Experimental web browser project to understand the limits of Claude

zlib decompression wrapper (RFC 1950) #65

open opened by pierrelf.com

Implement a zlib decompression wrapper in the image crate per RFC 1950.

Requirements#

  • Parse zlib header: CMF byte (compression method + window size) and FLG byte (check bits, dict flag, compression level)
  • Validate the header checksum (CMF*256 + FLG must be multiple of 31)
  • Delegate to DEFLATE decompressor for the compressed data
  • Verify Adler-32 checksum of the uncompressed data
  • API: fn zlib_decompress(input: &[u8]) -> Result<Vec<u8>, ZlibError>

Acceptance Criteria#

  • Correctly decompresses zlib-wrapped data
  • Rejects invalid headers and checksum mismatches
  • Unit tests with known zlib compressed data
  • No external dependencies, no unsafe

Dependencies#

  • Requires DEFLATE decompressor

Phase 7 — Image Decoders

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mgwaqqwf4y2h