def METHOD_NAME(fileobj, chunk_size=1024*1024, algorithm=hashlib.md5):
    checksum = algorithm()
    while True:
        chunk = fileobj.read(chunk_size)
        if not chunk:
            break
        checksum.update(chunk)
    return str(checksum.hexdigest())