Skip to content

Commit

Permalink
Pad hashes with zeroes when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
qgustavor authored and ClaudiuCeia committed Sep 13, 2024
1 parent 810c5d6 commit 62b683c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dhash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const dhash = async (pathOrSrc: string | Uint8Array) => {
}
}

return parseInt(out.join(""), 2).toString(16);
return parseInt(out.join(""), 2).toString(16).padStart(16, 0);
};

export const compare = (hash1: string, hash2: string) => {
Expand Down

0 comments on commit 62b683c

Please sign in to comment.