Skip to content

Commit f4e73ee

Browse files
authored
Merge pull request #1986 from Odyhibit/master
2 parents d751117 + 0a94c4a commit f4e73ee

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/core/operations/RailFenceCipherDecode.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class RailFenceCipherDecode extends Operation {
7272
}
7373
}
7474

75-
return plaintext.join("").trim();
75+
return plaintext.join("");
7676
}
7777

7878
}

src/core/operations/RailFenceCipherEncode.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class RailFenceCipherEncode extends Operation {
6666
rows[rowIdx] += plaintext[pos];
6767
}
6868

69-
return rows.join("").trim();
69+
return rows.join("");
7070
}
7171

7272
}

tests/operations/tests/Ciphers.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,4 +528,15 @@ TestRegister.addTests([
528528
}
529529
],
530530
},
531+
{
532+
name: "Rail Fence Cipher Encode: Normal with Offset with Spaces",
533+
input: "No one expects the spanish Inquisition.",
534+
expectedOutput: " e n ut.ooeepcstesaihIqiiinNnxthpsnso",
535+
recipeConfig: [
536+
{
537+
"op": "Rail Fence Cipher Encode",
538+
"args": [3, 2]
539+
}
540+
],
541+
},
531542
]);

0 commit comments

Comments
 (0)