12-02-2015, 04:21 AM
As magnum says, you can optimise quite a bit. I forget exactly how it works, but Python's md5 has an update() method, so you can create the digest of the first chunk and simply copy it every loop. I reccommend testing with some known hashes to make sure you're doing it right; things like newlines can mak everything go wrong.