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

Pretty warning when one or more characters are duplicates in the charset #3

Closed
wants to merge 2 commits into from

Conversation

xplshn
Copy link

@xplshn xplshn commented May 3, 2024

This PR fixes #2

@quackduck
Copy link
Owner

Should this be just a warning or a full error? I'm on the side of making this a fatal error.

@xplshn
Copy link
Author

xplshn commented May 3, 2024

But what if someone wants to use aces in a script where the charset may be determined by the user or data that could contain repetitions?

Anyways, its up to you to decide this. The first commit makes it a fatal error, the second I thought about the case I just mentioned and decided to make it a warning

@quackduck
Copy link
Owner

quackduck commented May 3, 2024

But what if someone wants to use aces in a script where the charset may be determined by the user or data that could contain repetitions?

Repeats in a charset make it impossible to decode data. Think of what would happen if two digits looked the exact same: you'd never be sure what number you actually have. Here's another example, what if I encoded with the charset 00? Any data I put in would just get replaced with zeros, and you'd have no hope of reconstructing what I put in.

@xplshn
Copy link
Author

xplshn commented May 4, 2024

Its up to you to decide what to do, the warning could be made into an error and use a simple global bool to have it be a warning in lax situations

@xplshn xplshn closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashes upon running encoding with a string with two of the same letter
2 participants