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

TEXT-encoding of 'aa9' and 'aa`' identical #4

Open
adrianschlatter opened this issue May 26, 2021 · 2 comments
Open

TEXT-encoding of 'aa9' and 'aa`' identical #4

adrianschlatter opened this issue May 26, 2021 · 2 comments

Comments

@adrianschlatter
Copy link

Encoding the messages 'aa9' and 'aa`' to TEXT gives identical results for both which can't be correct.

toText('aa`', [ /* TEXT */ 239, 31, 0, 0, 32, 9, 29, 47, 1, 33, 57, 9, 44, 64, 1, 43, 90, 2, 64, 95, 1, 69, 122, 9, 83, 127, 2, 96, 255, 1, 0])

=> [239, 89, 190, 254]

toText('aa9', [ /* TEXT */ 239, 31, 0, 0, 32, 9, 29, 47, 1, 33, 57, 9, 44, 64, 1, 43, 90, 2, 64, 95, 1, 69, 122, 9, 83, 127, 2, 96, 255, 1, 0])

=> [239, 89, 190, 254]

@datalog
Copy link
Owner

datalog commented Jun 14, 2021

First of all thank you for your feedback.

It is true that this function may return the same result for different chunks of data. Please, keep in mind that this is not standalone function, this is just a part of a cascade. Every next step will revaluate data again in order to choose optimum encoding method... This also helps to avoid mentioned collision.

@adrianschlatter
Copy link
Author

I agree with you. However, it is apparently not enough to assure correctness. I tried a bit with your nice datamatrix generator tool and found a collision (i.e. same datamatrix) for these strings:

  • "aaaaaaaaaaa9"
  • "aaaaaaaaaaa`"

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

2 participants