Skip to content

Commit

Permalink
string position fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneashleyberry committed Sep 19, 2021
1 parent dac530e commit 121aef5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/src/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function findEntropy(text: string): Array<Finding> {
results.push({
text: bs,
reason: "base64",
index: index + word.indexOf(bs),
index: index + line.indexOf(bs),
});
}
});
Expand All @@ -47,15 +47,13 @@ export function findEntropy(text: string): Array<Finding> {
results.push({
text: hs,
reason: "hex",
index: index + word.indexOf(hs),
index: index + line.indexOf(hs),
});
}
});

index += word.length;
});

index += 1;
index += line.length + 1;
});

return results;
Expand Down

0 comments on commit 121aef5

Please sign in to comment.