This commit is contained in:
john19696 2022-09-22 16:53:29 +01:00
parent 00f0101723
commit be97a0062e

View File

@ -133,13 +133,13 @@ class GenerateAllHashes extends Operation {
str = Utils.arrayBufferToStr(arrayBuffer, false),
byteArray = new Uint8Array(arrayBuffer);
var value, output = "";
let value, output = "";
// iterate over each of the hashes
this.hashes.forEach(function (hash) {
// calculate the hash value
if (hash.type == "arrayBuffer") {
if (hash.type === "arrayBuffer") {
value = hash.hash.run(arrayBuffer, hash.params);
} else if (hash.type == "str") {
} else if (hash.type === "str") {
if ("params" in hash) {
value = hash.hash.run(str, hash.params);
} else {
@ -147,7 +147,7 @@ class GenerateAllHashes extends Operation {
}
}
// output the values base on the args: length & names
if (length == "All" || value.length === parseInt(length)) {
if (length === "All" || value.length === parseInt(length)) {
if (names) {
output += hash.name + ":" + " ".repeat(13-hash.name.length);
}
@ -155,7 +155,7 @@ class GenerateAllHashes extends Operation {
}
});
if (length == "All") {
if (length === "All") {
output += "\nChecksums:" +
"\nFletcher-8: " + (new Fletcher8Checksum).run(byteArray, []) +
"\nFletcher-16: " + (new Fletcher16Checksum).run(byteArray, []) +