import hashlib


def compute_hashes(filename):
    """Helper function to compute MD5 and SHA1 hashes"""
    retval = {}
    md5 = hashlib.md5()
    sha1 = hashlib.sha1()
    with open(filename, 'rb') as f:
        while True:
            data = f.read(64 * 1024)
            if not data:
                break
            md5.update(data)
            sha1.update(data)
    retval['md5'] = md5.hexdigest()
    retval['sha1'] = sha1.hexdigest()
    return retval