Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AI_MARKER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This contribution was prepared with AI assistance from OpenCode.
2 changes: 1 addition & 1 deletion src/core/operations/ROT13BruteForce.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ROT13BruteForce extends Operation {
const cribLower = crib.toLowerCase();
const lowerStart = "a".charCodeAt(0), upperStart = "A".charCodeAt(0), numStart = "0".charCodeAt(0);
const result = [];
for (let amount = 1; amount < 26; amount++) {
for (let amount = 0; amount < 26; amount++) {
const rotated = sample.slice();
for (let i = 0; i < rotated.length; i++) {
if (rotateLower && lowerStart <= rotated[i] && rotated[i] < lowerStart + 26) {
Expand Down
22 changes: 22 additions & 0 deletions tests/operations/tests/Rotate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,28 @@ TestRegister.addTests([
},
],
},
{
name: "ROT13 Brute Force: includes pass-through",
input: "Abc123",
expectedMatch: /^Amount = {2}0: Abc123\nAmount = {2}1:/,
recipeConfig: [
{
op: "ROT13 Brute Force",
args: [true, true, true, 100, 0, true, ""]
},
],
},
{
name: "ROT13 Brute Force: filters a pass-through sample",
input: "__Ab1__",
expectedOutput: "Ab1",
recipeConfig: [
{
op: "ROT13 Brute Force",
args: [true, true, true, 3, 2, false, "ab1"]
},
],
},
{
name: "ROT47: nothing",
input: "",
Expand Down