I am dumping a string of 0s and 1s of length 4807100171 into a pickle
file because I had previous trouble with bitarray
and wanted to see if pickle could be a solution to my problem. However, after I load it, it now is of length 512132875.
Why is that?
I have searched to see if there is any limitations from pickle, but I haven't found anything... If there is a well known reason, I might not be using the correct key words...
Edit:
You can fill a string b
of random values so you get a length of 4807100171 with the technique you prefer - perhaps something like a simple for loop going to 4807100171. I personally encrypt original data using Huffman coding but it would be a long example that I feel is not really necessary here.
I then dump the string b
as follow:
b = ""
for i in range(4807100171)
b += 0
import cPickle as pickle
pickle.dump(b, open("string.p", "wb"), pickle.HIGHEST_PROTOCOL)