mirror of
https://github.com/gchq/CyberChef
synced 2026-02-23 16:13:32 +00:00
Fix regular expresion crash in extract hashes
This commit is contained in:
@@ -68,8 +68,8 @@ class ExtractHashes extends Operation {
|
||||
const regex = new RegExp(`(\\b|^)[a-f0-9]{${hashCharacterLength}}(\\b|$)`, "g");
|
||||
const searchResults = search(input, regex, null, false);
|
||||
|
||||
hashCount += searchResults.split("\n").length - 1;
|
||||
results.push(searchResults);
|
||||
hashCount += searchResults.length;
|
||||
results.push(...searchResults);
|
||||
}
|
||||
|
||||
let output = "";
|
||||
@@ -77,7 +77,7 @@ class ExtractHashes extends Operation {
|
||||
output = `Total Results: ${hashCount}\n\n`;
|
||||
}
|
||||
|
||||
output = output + results.join("");
|
||||
output = output + results.join("\n");
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user