mirror of
https://github.com/gchq/CyberChef
synced 2025-01-04 00:38:41 +00:00
Fix regular expresion crash in extract hashes
This commit is contained in:
parent
61295a968e
commit
6b95ba7dd6
1 changed files with 3 additions and 3 deletions
|
@ -68,8 +68,8 @@ class ExtractHashes extends Operation {
|
||||||
const regex = new RegExp(`(\\b|^)[a-f0-9]{${hashCharacterLength}}(\\b|$)`, "g");
|
const regex = new RegExp(`(\\b|^)[a-f0-9]{${hashCharacterLength}}(\\b|$)`, "g");
|
||||||
const searchResults = search(input, regex, null, false);
|
const searchResults = search(input, regex, null, false);
|
||||||
|
|
||||||
hashCount += searchResults.split("\n").length - 1;
|
hashCount += searchResults.length;
|
||||||
results.push(searchResults);
|
results.push(...searchResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
@ -77,7 +77,7 @@ class ExtractHashes extends Operation {
|
||||||
output = `Total Results: ${hashCount}\n\n`;
|
output = `Total Results: ${hashCount}\n\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
output = output + results.join("");
|
output = output + results.join("\n");
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue