summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/md5.py
blob: 9bc9e2328f9eb199439f0cd806348654fc1492a5 (plain)
1
2
3
4
5
6
7
8
import hashlib

def md5_file(fname):
    hash_md5 = hashlib.md5()
    with open(fname, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hash_md5.update(chunk)
    return hash_md5.hexdigest()