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

rs.RSCoder failed if n = 255 and k = 255 #9

Open
anujkgarg opened this issue Nov 27, 2019 · 4 comments
Open

rs.RSCoder failed if n = 255 and k = 255 #9

anujkgarg opened this issue Nov 27, 2019 · 4 comments

Comments

@anujkgarg
Copy link

coder = rs.RSCoder(255, 255)
code = coder.encode(data, False, None, True)

If codeword and message length are 255, it is failing with error -

Codeword length n must be greater than message length k

@anujkgarg
Copy link
Author

It fails when k = n. I have tried it with k = n = 50 also.

@JoelStienlet
Copy link

I think this is inherent to the math of Reed Solomon codes.
From the main description "k is the length of the message, must be less than n".
Less than strictly, not less or equal.
Also on wikipedia: https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction#Constructions

@anujkgarg
Copy link
Author

ok, thanks

@lrq3000
Copy link
Owner

lrq3000 commented Nov 27, 2019

Hello, yes indeed that's why it fails, but the encoder class could still check this potential error and raise a more meaningful exception when this case is detected, I reopen the issue until I get some time to add this, thanks for reporting the issue and thank you @JoelStienlet for answering :-)

@lrq3000 lrq3000 reopened this Nov 27, 2019
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