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

Bug report: Someone trimmed the rail fence. #1589

Open
Odyhibit opened this issue Jun 10, 2023 · 0 comments · May be fixed by #1590
Open

Bug report: Someone trimmed the rail fence. #1589

Odyhibit opened this issue Jun 10, 2023 · 0 comments · May be fixed by #1590
Labels

Comments

@Odyhibit
Copy link

Describe the bug
The Rail Fence cipher trims white space when encoding, which makes the makes the decoding not work.

To Reproduce

  1. Input "These aren't the droid you're looking for"
  2. Rail Fence Cipher Encode
  3. Key:3 Offset:1
  4. Rail Fence Cipher Decode
  5. Key:3 Offset:1
  6. Output "Tresehare 't nhe troid yod'reuloo ingkfo"

Expected behaviour
The Output is the same text as the Input.

In the code for the rail fence cipher there is a .trim() that is removing the space that should exist as the first character. Using the provided settings the space that is the 13th character of the input becomes the first character of the encoded text. This character is then removed before the text is displayed in the Output.
Screenshot 2023-06-09 at 7 47 32 PM

@Odyhibit Odyhibit added the bug label Jun 10, 2023
@Odyhibit Odyhibit linked a pull request Jun 13, 2023 that will close this issue
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 a pull request may close this issue.

1 participant