Changaco / python-libarchive-c

Python interface to libarchive
Other
70 stars 37 forks source link

Support reading CRC32 from header #54

Open gregyski opened 7 years ago

gregyski commented 7 years ago

Would it be possible to support reading the CRC32 hash for the contained files from headers that contain them, such as those for 7-zip? Currently the entries produced by file_reader() do not seem to do so.

Thank you.

Changaco commented 7 years ago

I don't know, it depends on whether or not libarchive has a function we can use to access them.

gregyski commented 7 years ago

Aye. I've been trying to determine that. I think it's stored like the other properties like uncompressed size and modified timestamp.

Edit: Actually perhaps not, _7zip_entry doesn't seem to contain it. Edit 2: I think, for 7zip, it may be obtained in read_SubStreamsInfo(). But I don't know the file format well enough to be sure. I'll look at the 7zip source sometime in the next week and see if I can determine if it's something libarchive accesses or not. Even if it is, it may not have a format-independent function for obtaining it.

eadmaster commented 5 months ago

related: https://github.com/libarchive/libarchive/issues/1003