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
358 stars 86 forks source link

Using multiple instances of RSCodec fails #71

Open christakahashi opened 1 year ago

christakahashi commented 1 year ago

the following code fails on the last line

_test_coder = reedsolo.RSCodec(5,c_exp=8)

txt = np.random.randint(0,32,27,dtype=np.int8); print(txt)
_rtxt = _test_coder.encode(txt); print(list(_rtxt))
_test_coder2 = reedsolo.RSCodec(5,c_exp=9)
_ptxt = _test_coder.decode(_rtxt)[0]; print(list(_ptxt))

It works fine when i don't instantiate _test_coder2. I started with the default version installed by pip (1.7.0) and then tried with the version given by pip with the --pre flag (2.1.1b1). both produce the same error. I'm using anaconda environments and python 3.9.

Also, there doesn't seem to be a reedsolo.version attribute so i'm getting these version numbers from the pip freeze command.