Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbols other than 8 bit #12

Closed
noah-jones opened this issue Aug 11, 2016 · 4 comments
Closed

Symbols other than 8 bit #12

noah-jones opened this issue Aug 11, 2016 · 4 comments

Comments

@noah-jones
Copy link

noah-jones commented Aug 11, 2016

Hi,
I would like to use an alphabet of 2^5 possible symbols (base32 encoding) for my message and code. I tried setting c_exp to 5 and get the following error:

>>> rs = reedsolo.RSCodec(nsym=2, nsize=8, c_exp=5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/reedsolo-0.5-py3.4-linux-x86_64.egg/reedsolo.py", line 756, in __init__
    init_tables(prim, generator, c_exp)
  File "/usr/local/lib/python3.4/dist-packages/reedsolo-0.5-py3.4-linux-x86_64.egg/reedsolo.py", line 201, in init_tables
    gf_exp[i] = x # compute anti-log for this value and store it in a table
ValueError: byte must be in range(0, 256)

I want to get something like a flight code (length 8 digits/characters) with error correction.
Has anyone tried using different symbols? Is it possible using the base library instead of the hight level API?
Thanks

@lrq3000
Copy link
Collaborator

lrq3000 commented Aug 11, 2016

Yes it should work with the latest version here:

https://github.com/lrq3000/reedsolomon

There is also various unit tests with different fields orders, so this case should be covered without any problem.

These changes to support different fields should be merged in this repo with PR #11 (but @tomerfiliba seems to be away currently...).

@lrq3000
Copy link
Collaborator

lrq3000 commented Oct 15, 2017

BTW just to precise, the support for other Galois fields was supported already by the core code here, but not the high level API because I forgot to automatically manage the refresh of the data structures. This is fixed in the latest version in #11 and several users reported it works fine :-)

@lrq3000
Copy link
Collaborator

lrq3000 commented Mar 1, 2020

Fixed with the merge of #11

@lrq3000 lrq3000 closed this as completed Mar 1, 2020
@ovgeorge
Copy link

I'm using c_exp=2 and getting and error, is this how it supposed to work?

Traceback (most recent call last):
  File "encoding_test.py", line 6, in <module>
    rsc = RSCodec(nsym=2, nsize=nsize, c_exp=2)
  File "/Users/george/.pyenv/versions/3.7.9/lib/python3.7/site-packages/reedsolo.py", line 865, in __init__
    self.gf_log, self.gf_exp, self.field_charac = init_tables(prim, generator, c_exp)
  File "/Users/george/.pyenv/versions/3.7.9/lib/python3.7/site-packages/reedsolo.py", line 293, in init_tables
    x = gf_mult_noLUT(x, generator, prim, field_charac+1)
  File "/Users/george/.pyenv/versions/3.7.9/lib/python3.7/site-packages/reedsolo.py", line 387, in gf_mult_noLUT
    if prim > 0 and x & field_charac_full: x = x ^ prim # GF modulo: if x >= 256 then apply modular reduction using the primitive polynomial (we just substract, but since the primitive number can be above 256 then we directly XOR).
TypeError: '>' not supported between instances of 'list' and 'int'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants