klauspost / reedsolomon

Reed-Solomon Erasure Coding in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two zero valued bytes added to the end of decoded file

simonsben opened this issue · comments

I believe using three data and two parity (and potentially others) an additional two zero valued bytes are added to the end of the decoded file.

Steps to reproduce

  • Clone repo
  • Create test/ folder within examples/
  • Encode file with go run ../simple-encoder.go -data 3 -par 2 -out . ../README.md
  • Decode file with go run ../simple-decoder.go -data 3 -par 2 -out test.md README.md

The decoded file now has an additional zero byte at the end of the file. This can be seen using hexedit test.md

I see that its listed as a behavior, is it not worth correcting though?

@simonsben The example is meant to be simple, not exhaustive. You are welcome to send an alternative.