^@^@^@ added to the end of the file
chranmat opened this issue · comments
Hi,
I recently downloaded this library and started to test the examples attached in the examples/ folder.
When decoding a random text file I experienced that a string ^@^@^@ is added to the end of the decoded file.
Steps to reproduce:
- Create a text file with some content. (Mark! Several newlines is used between the text in this file)
- Use "simple-encoder" to encode the file in to 6 shards (default 4+2):
- Delete the original file and 2 of 6 encoded shards
- Decode the remaining shards with "simple-decoder" (default 4+2)
Expected Result:
File is recovered in the original state
Actual Result:
The string ^@^@^@ is added on separate linje in the end of the file.
Additional info:
When using another example text with more content and less newlines this does not happen.
This picture is from when using the exact same method to reproduce, but different content:
Attached is also original and decoded file that reproduces the issue:
Original:
file.original.txt
Decoded:
file.decided.txt
https://github.com/klauspost/reedsolomon#splittingjoining-data
An important thing to note is that you have to keep track of the exact input size. If the size of the input isn't divisible by the number of data shards, extra zeros will be inserted in the last shard.