Skip to content

Mimic zlib.compress #10

@bozhinov

Description

@bozhinov

Hello,

Im trying to mimic the zlib.compress method. the end goal is not a zip file but a compressed bin

ZipInfo -> file header was easy as it is static - b'\x78\x9C'

According to Wiki that one is probably the version
https://en.wikipedia.org/wiki/Zip_(file_format)

I failed with DataDescriptor though. It's 4 bytes but it is not the CRC32, file size or compressed file size
print(struct.pack(b'L', self.CRC))

If I unpack the actual 4 bytes I get from zlib.compress I get something really close to the CRC
3947408205 (for ZipStream) vs 3580820856 (for zlib)

Looking at the code I may be getting the CRC of the current 8kb chunk and not the whole file
am I close ?

Momchil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions