Skip to content

Bug report: Someone trimmed the rail fence. #1589

Open
@Odyhibit

Description

@Odyhibit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions