Repository navigation
FIX Include settings that change output in MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers - #3288
Merged
Roman Lutz (romanlutz) merged 4 commits intoOct 18, 2026
Conversation
…rap, SelectiveText and Zalgo converter identifiers MathObfuscationConverter now identifies hint and suffix, NegationTrapConverter gets an identifier with wrong_value and the trap template, SelectiveTextConverter adds word_separator for word-level strategies and ZalgoConverter adds seed. Fixes microsoft#3287 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The identifier coverage across these four converters looks very thorough. Gating word separator in SelectiveTextConverter only when using word level selection strategies avoids invalidating hashes for character level transformations where the separator has no effect. Similarly, omitting seed when None preserves the unseeded hash for ZalgoConverter while distinguishing seeded runs. Checked registration against ConverterRegistry and the instance collision tests all pass. |
Roman Lutz (romanlutz)
approved these changes
Oct 18, 2026
Roman Lutz (romanlutz)
enabled auto-merge
October 18, 2026 07:37
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e3986dd-0311-4a86-a594-8e622d240d52
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e3986dd-0311-4a86-a594-8e622d240d52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3287.
Four text converters left settings that change their output out of their identifiers, so differently configured instances had the same hash and default registry name. For example,
NegationTrapConverter(wrong_value="1234")andNegationTrapConverter(wrong_value="hunter2")collided, and registering the second one raisedValueError: Instance 'NegationTrapConverter::89a3d225' already exists.Each converter now adds the missing settings:
MathObfuscationConverter:hint_hashandsuffix_hash, SHA-256 prefixes of the resolved hint and suffix, the same wayAddTextImageConverteridentifiestext_to_add. An explicit default hint or suffix keeps the default identity, and""(disabled) gets its own.NegationTrapConverter: a new_build_identifier()withwrong_valueandtrap_template_hash. Before this it had no params at all.SelectiveTextConverter:word_separator, only for word-level strategies, because character-level and token strategies never split on it. Their hashes are unchanged.ZalgoConverter:seed, like the other seeded converters.Noneparams are not hashed, so unseeded Zalgo converters keep their hash.Conversion behavior is unchanged. The default hashes of
MathObfuscationConverter,NegationTrapConverterand word-levelSelectiveTextConverterchange once, because they now include these settings. Nothing in the repository pins these hashes.Tests and Documentation
ConverterRegistry, and that equal settings keep the same hash.SelectiveTextConverteralso checks that character-level strategies ignoreword_separator, andZalgoConverterthat an unseeded converter has noseedparam. Onmain, 10 of the new tests fail. With this change, all of them pass.pytest tests/unit/converter tests/unit/registry tests/unit/backend/test_converter_service.py: 3734 passed, 38 skipped.ruff check,ruff formatandty checkpass on the changed files.git diff --checkis clean.🤖 Generated with Claude Code