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

Can't create cover, containing non-English words #19

Open
YoungTeurus opened this issue Jul 28, 2023 · 4 comments
Open

Can't create cover, containing non-English words #19

YoungTeurus opened this issue Jul 28, 2023 · 4 comments

Comments

@YoungTeurus
Copy link

The problem part is:

const valid = secret && (DontUseCover || (cover && /\w \w/.test(cover)));

\w \w Regex doesn't match non-English symbols (and also words splitted with 2 spaces):
image
How about changing in to .( )+., so it was those two symbols separated by any count of spaces?
image

@J-295
Copy link

J-295 commented Jul 28, 2023

I believe using the following code instead would be better:
cover.trim().includes(' ')

The line could be changed to this:

const valid = secret && (DontUseCover || cover?.trim().includes(' ')); 

@YoungTeurus
Copy link
Author

YoungTeurus commented Jul 29, 2023

Yeah, that should work too.

@SammCheese
Copy link
Owner

Added! Thanks for making me aware of this issue!

@YoungTeurus
Copy link
Author

Something doesn't work still.
I can't encrypt messages with next covers (after // is a comment):

привет мир // fully russian words
привет 123 // russian + numbers
123 привет
abc пфщ // russian + english
abc пвщ abc // russian between english
. . // 2 dots with space between
abc  abc  // 2 spaces between english words

But I can encrypt with covers:

abc abc  // only english
123 123 // only numbers
abc abc пвщ // 2 english words + russian
пвщx xпвщ // INTERESTING CASE: russian words + english characters on the end and start of each word

@SammCheese SammCheese reopened this Aug 10, 2023
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

3 participants