Calcolare Md5 Di Un File

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