def md5sum(file):
    m = hashlib.md5()
    while True:
        d = file.read(8096)
        if not d:
            break
        m.update(d)
    return m.hexdigest()
Calculate the md5 checksum of a file-like object without reading its
dataset/ETHPy150Open scrapy/scrapy/scrapy/utils/misc.py/md5sum