Skip to content

Commit

Permalink
Fixed issues with const/let and changed default character length
Browse files Browse the repository at this point in the history
  • Loading branch information
MShwed committed Mar 31, 2024
1 parent de8ed69 commit a6b774d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/operations/ExtractHashes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ExtractHashes extends Operation {
{
name: "Hash character length",
type: "number",
value: 32
value: 40
},
{
name: "All hashes",
Expand All @@ -49,7 +49,7 @@ class ExtractHashes extends Operation {
* @returns {string}
*/
run(input, args) {
let results = [];
const results = [];
let hashCount = 0;

const hashLength = args[0];
Expand All @@ -61,9 +61,9 @@ class ExtractHashes extends Operation {

if (searchAllHashes) hashBitLengths = [4, 8, 16, 32, 64, 128, 160, 192, 224, 256, 320, 384, 512, 1024];

for (let hashBitLength of hashBitLengths) {
for (const hashBitLength of hashBitLengths) {
// Convert bit length to character length
let hashCharacterLength = (hashBitLength / 8) * 2;
const hashCharacterLength = (hashBitLength / 8) * 2;

const regex = new RegExp(`(\\b|^)[a-f0-9]{${hashCharacterLength}}(\\b|$)`, "g");
const searchResults = search(input, regex, null, false);
Expand Down

0 comments on commit a6b774d

Please sign in to comment.