stream-unzip | Python function to stream unzip | Compression library
kandi X-RAY | stream-unzip Summary
kandi X-RAY | stream-unzip Summary
Python function to stream unzip all the files in a ZIP archive: without loading the entire ZIP file or any of its files into memory at once
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Stream data from a zipfile generator .
- Returns the long description of the README . md file .
stream-unzip Key Features
stream-unzip Examples and Code Snippets
Community Discussions
Trending Discussions on stream-unzip
QUESTION
According to https://en.wikipedia.org/wiki/ZIP_(file_format)#ZIP64
The original .ZIP format had a 4 GB (2^32 bytes) limit on various things (uncompressed size of a file, compressed size of a file, and total size of the archive), as well as a limit of 65,535 (2^16-1) entries in a ZIP archive.
Is the 2^32 value correct? By my understanding, the maximum value should be the maximum possible value held in a 32 bit unsigned integer, which is 2^32-1
I know that 2^32-1 does have particular meaning according to the ZIP spec at https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT (usually mentioned as 0xFFFFFFFF), so I don't want to assume anything.
The 2^16-1 limit for number of entries does seem right to me, as the maximum value that can be stored in a 16 bit unsigned integer.
Context: I'm writing code to write ZIP files in a streaming way in Python https://github.com/uktrade/stream-zip, as well code to open ZIP files in a streaming way https://github.com/uktrade/stream-unzip, and I want both to handle the various limits correctly. Or if not "correctly" (say if there is no "correctly") as best as is reasonable.
...ANSWER
Answered 2022-Jan-03 at 07:07Elsewhere on the same Wikipedia page includes the minus 1: https://en.wikipedia.org/wiki/ZIP_(file_format)#Limits
The maximum size for both the archive file and the individual files inside it is 4,294,967,295 bytes (2^32−1 bytes, or 4 GB minus 1 byte) for standard ZIP.
Also in the ZIP specification at https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT, there are various mentions of the size fields being 4 bytes, e.g.
QUESTION
I'm writing my own unzip code, and (from trial and error, no understanding) it looks like the CRC-32 algorithm on the one byte that decryption requires doesn't quite match up with zlib's. To convert from one to the other:
...ANSWER
Answered 2021-Sep-06 at 06:30Ok, you're not completely wrong. It is indeed the same CRC-32 algorithm, but without the pre and post-processing (inverting the CRC coming in and going out). It is truly odd code that is trying to replicate that with the zlib.crc32
function. All you need is this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stream-unzip
You can use stream-unzip like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page