Skip to content

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

3 participants