support optional crc32 for uncompressed streaming zip32 and zip64 #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the idea originally discussed in #17 and #58, producing ZIP files with actual length in local header and 0 crc32, and including a data descriptor with the length and actual crc32.
This allows specifying ZIP file members with
NO_COMPRESSION_64(file_size, 0)
andNO_COMPRESSION_32(file_size, 0)
and does not raise the invalid crc32 exception, but instead computes it and stores it in the data descriptor.The ZIP files produces with this implementation should:
unzip -t
teststream_unzip
(according to my testing) without any additional changes. I believe this was the main objection to the ideas in Support streaming with NO_COMPRESSION_64 and NO_COMPRESSION_32 #58, since discussion was about making both length and crc32 optional, now only, crc32 is.This would really help our use case to be able to support this without having a custom fork.
The main use case is being able to stream-zip files from S3-like buckets where the size is available, but crc-32 usually is not (also mentioned in #17)