'Process a file into a single hash, by taking
bite-sized chunks.
Useful for signing the full file.'

def _hash_large_file(self, filename, chunk_size=None):

    hasher = hashlib.sha256()
    chunk_size = (chunk_size or (hasher.block_size * 1000))
    with open(filename, 'rb') as fp:
        while True:
            bytes = fp.read(chunk_size)
            if (not bytes):
                break
            hasher.update(bytes)
    return hasher.hexdigest()
