klauspost / reedsolomon

Reed-Solomon Erasure Coding in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are different encoders compatible?

tdunning opened this issue · comments

If I create 6 + 6, 6 + 4 and 6 + 2 (data + parity) encoders, will the first two parity blocks be identical for all three?

As far as I can tell the Cauchy matrix is, but test it out anyway I may be wrong.

Very cool. Interesting possibilities arise from this.

Just to finish off the story, I checked the results and

enc1 := reedsolomon.New(12, 2)
enc2 := reedsolomon.New(12, 4) 

do actually seem to produce the same first two parity blocks. I checked this for 2,3,4,6,12 parity blocks and the encoders all seem to produce the same parity blocks where there is overlap.

I interpret this as the underlying code using the same parity generating matrix and simply truncating it as needed to match what is requested. This pretty much explains why speed is inversely proportional to number of parity blocks.