# Use deduplication to save space.
prefix = data[:MINIMUM_BLOCK]
# Find the best 'matching' part of the blob
ind = blob.find(prefix, ind+1)
length = len(os.path.commonprefix([data, bytes(blob[ind:ind+MAXIMUM_BLOCK])]))
bestlen, bestind = length, ind
# Store the index of the match
part, data = data[:bestlen], data[bestlen:]
part_list.append((bestind, bestlen))
part, data = data[:MINIMUM_BLOCK], data[MINIMUM_BLOCK:]
blob[used:used+len(part)] = part
part_list.append((used, len(part)))
fid = "".join(secrets.choice(string.ascii_letters+string.digits) for i in range(16))