Closed za3k closed 1 year ago
Oh also, in case it's an issue with potential string lengths, reedsolo.RSCodec(300, c_exp=12).encode(b'a')
instead outputs:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.9/site-packages/reedsolo.py", line 893, in encode
enc.extend(rs_encode_msg(chunk, self.nsym, fcr=self.fcr, generator=self.generator, gen=self.gen[nsym]))
File "/usr/lib/python3.9/site-packages/reedsolo.py", line 514, in rs_encode_msg
msg_in = _bytearray(msg_in)
File "/usr/lib/python3.9/site-packages/reedsolo.py", line 279, in _bytearray
return array("i", obj)
ValueError: bytes length not a multiple of item size
About your first question, it's an uncaught error but it's normal, this happens because you initialized RSCodec with too many ECC symbols (300) when by default the max total message length nsize=255. Now there will be an error message.
About your second question, this was indeed a bug, which was kindly fixed by someone else in #46 and is now merged, so this bug does not happen anymore.
Thanks for adding an error
This code:
Returns
bytearray(b'')
on my computer. Adjusting the number down causes it to return something.