tomerfiliba-org / reedsolomon

⏳🛡 Pythonic universal errors-and-erasures Reed-Solomon codec to protect your data from errors and bitrot. Includes a future-proof zero-dependencies pure-python implementation 🔮 and an optional speed-optimized Cython/C extension 🚀
http://pypi.python.org/pypi/reedsolo
Other
351 stars 86 forks source link

Reed Solomon for large file saving #77

Open eragondr opened 3 months ago

eragondr commented 3 months ago

First of all ! Thank you for your works. Love it .

So here is my problem. I have a file about 4gb. I want to break it into "N" pieces and store across many servers ,if some of these server go down , i can still retrieve all the files and recover origin file. In others words if some "x" chunk file is lost i can use the rest "N-x" chunk files to recover origin file . How can I achieve this using Reed Solomon .

I tried for small byte array it works . rsc = RSCodec(10) data =bytearray(range(0,4)) encode= rsc.encode(data)

bytearray(b'\x00\x01\x02\x03\x15\xf5\xe3\x86\xfa\x16/\xae\xc8 ')

so my strategy is encode the bytesarray then split it in to part : the 1st part is the data which is \x00\x01\x02\x03 this I will break in to many pieces dataE = encode[0:len(data)] the 2nd part is parity x15\xf5\xe3\x86\xfa\x16/\xae\xc8 this will be saved some where safe parity = encode[len(data):] and the dataE and data are the same. image

However this does not work with large file. in my example i use a video have 1.91mb image

Looking forward for your rely . Thank you