I have questions about the code. Why do you need to say int('0x1', 16) and int('0x2', 16)? Why not just write 0x1 and 0x2? Or just plain 1 and 2? I'm also perplexed by the goal as this seems to just call zipfile.write under the hood, which already streams to a zip file without accumulating a memory buffer? [0] https://github.com/BuzonIO/zipfly/blob/master/zipfly/zipfly....
Of course, by crafting a special file-like object you could avoid this too, but perhaps a bit less elegantly.