Skip to content

fix: broken morse detection #149

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

Merged
merged 1 commit into from
Sep 23, 2023
Merged

fix: broken morse detection #149

merged 1 commit into from
Sep 23, 2023

Conversation

PierreDemailly
Copy link
Member

This PR fixes #144

The stringCharDiversity was breaking the test (and the analysis), in the morse.js fixture, we have somethings like:

  • ’.-‘: ‘a’, -> here, stringCharDiversity is 2
  • ’-…’: ‘b’, -> stringCharDiversity is 2
  • ’-.-.’: ‘c’, -> stringCharDiversity is 2
  • ’-..’: ‘d’, ->stringCharDiversity is 2
  • ’.’: ‘e’, -> stringCharDiversity is 1
  • ’..-.’: ‘f’, -> stringCharDiversity is 2
  • etc 


Actually the total counter of morseLiteral in the morse.js fixture is 37, which match:


else if (analysis.counter.morseLiteral >= 36) {
  encoderName = "morse";
}

That’s why I think this fix is fine.

I’ve also added a "not morse" detection test, I’m not sure about this test plus-value and the fixture’s accuracy but it should test there is no abuse with theses changes.

@fraxken fraxken merged commit 416b38d into master Sep 23, 2023
@fraxken fraxken deleted the fix-morse-obfuscation branch December 1, 2023 15:20
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

Successfully merging this pull request may close these issues.

Fix morse detection
2 participants