You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be great if there would be an easy, clean interface in 4.x for adding a callback which is able to work on the currently decompressed block of data, so you can e.g. calculate the sha1 hash value of a file while it is being decompressed blockwise to memory.
In 7z sdk theory this is an archive Extract call in test mode with ArchiveExtractCallback + ISequentialOutStream specified which inits the hash calculation, doing the hash update during the streams write calls and finalizing the hash when the extractcallback does its SetOperationResult.
Additional context
No response
Code of Conduct
By submitting this issue, I agree to follow bit7z's Code of Conduct
The text was updated successfully, but these errors were encountered:
Would be great if there would be an easy, clean interface in 4.x for adding a callback which is able to work on the currently decompressed block of data, so you can e.g. calculate the sha1 hash value of a file while it is being decompressed blockwise to memory.
I think it would be a great feature indeed, I will definitely add it to the library.
Thanks for the suggestion!
In 7z sdk theory this is an archive Extract call in test mode with ArchiveExtractCallback + ISequentialOutStream specified which inits the hash calculation, doing the hash update during the streams write calls and finalizing the hash when the extractcallback does its SetOperationResult.
Yeah, I need to find out the best API for providing the feature.
I have some ideas which I need to test out.
I consider the v4.0 feature complete, so I'll probably add this feature to the next v4.1.
I've implemented it myself already (not worth or already nice enough for a pull request).
Generally I've added 2 callbacks to bitAbstractArchiveHandler
one which hooks into ExtractCallback::GetStream and allows the callback to set its own outStream instead of using the default implementation
one which is called in SetOperationResult
additionally I've added the single test feature from my other feature request (which is pretty straight forward adding another testArc and test in bitinputarchive.cpp)
So when I want to calculate a sha1 from a single compressed file, I set up the 2 callbacks.
The GetStream one setups a new ISequentialOutStream which calls the sha1 update in its write method and the sha1 finalize is called in the SetOperationResult callback.
To trigger the callbacks I do a single entry test operation after setting up the callbacks.
As I said...not yet in an api-nice way, but functional ;-)
Having the stream-replace callback I will be able to solve my "give the decompressed files different names", too.
Feature description
Would be great if there would be an easy, clean interface in 4.x for adding a callback which is able to work on the currently decompressed block of data, so you can e.g. calculate the sha1 hash value of a file while it is being decompressed blockwise to memory.
In 7z sdk theory this is an archive Extract call in test mode with ArchiveExtractCallback + ISequentialOutStream specified which inits the hash calculation, doing the hash update during the streams write calls and finalizing the hash when the extractcallback does its SetOperationResult.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: