As explain in this article https://medium.com/@mpreziuso/is-gzip-deterministic-26c81bfd0a49 the md5 of two .tar.gz files that are the compression of the exact same set of files can be different. This is because it, for example, includes timestamp in the header of the compressed file.
In the article 3 solutions are proposed, and I would idealy like to use the first one wich is :
We can use the -n flag in gzip which will make gzip omit the timestamp and the file name from the file header;
And this solution works well:
tar -c ./bin |gzip -n >one.tar.gztar -c ./bin |gzip -n >two.tar.gzmd5sum one.tgz two.tgz
Nevertheless I have no idea of what will be a good way to do it in python.Is there a way to do it with tarfile(https://docs.python.org/2/library/tarfile.html)?
I need it for this tool.
Is there any simple way of generating (and checking) MD5 checksums of a list of files in Python? (I have a small program I'm working on, and I'd like to confirm the checksums of the files).
In my app I have a requirement to generate an MD5 checksum for a file. Could you please tell me if there is any way in which this can be achieved?
I'm having trouble generating code MD5 ,my hash code generating is :6d443e99c80115807f73b3a18530aeacand my Code SHA256 isa5f80ea7ac52cb818a5a7332155f802fc9e677de29c351438f7cb266f76ddfe2when this code to convert md5 ,It gets MD5 :6d443e99c80115807f73b3a18530aeacbut i cant MD5 to convert this SHA256 please help me