mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
linted
This commit is contained in:
parent
00f0101723
commit
be97a0062e
1 changed files with 46 additions and 46 deletions
|
@ -133,13 +133,13 @@ class GenerateAllHashes extends Operation {
|
||||||
str = Utils.arrayBufferToStr(arrayBuffer, false),
|
str = Utils.arrayBufferToStr(arrayBuffer, false),
|
||||||
byteArray = new Uint8Array(arrayBuffer);
|
byteArray = new Uint8Array(arrayBuffer);
|
||||||
|
|
||||||
var value, output = "";
|
let value, output = "";
|
||||||
// iterate over each of the hashes
|
// iterate over each of the hashes
|
||||||
this.hashes.forEach(function (hash) {
|
this.hashes.forEach(function (hash) {
|
||||||
// calculate the hash value
|
// calculate the hash value
|
||||||
if (hash.type == "arrayBuffer") {
|
if (hash.type === "arrayBuffer") {
|
||||||
value = hash.hash.run(arrayBuffer, hash.params);
|
value = hash.hash.run(arrayBuffer, hash.params);
|
||||||
} else if (hash.type == "str") {
|
} else if (hash.type === "str") {
|
||||||
if ("params" in hash) {
|
if ("params" in hash) {
|
||||||
value = hash.hash.run(str, hash.params);
|
value = hash.hash.run(str, hash.params);
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,7 +147,7 @@ class GenerateAllHashes extends Operation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// output the values base on the args: length & names
|
// 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) {
|
if (names) {
|
||||||
output += hash.name + ":" + " ".repeat(13-hash.name.length);
|
output += hash.name + ":" + " ".repeat(13-hash.name.length);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ class GenerateAllHashes extends Operation {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (length == "All") {
|
if (length === "All") {
|
||||||
output += "\nChecksums:" +
|
output += "\nChecksums:" +
|
||||||
"\nFletcher-8: " + (new Fletcher8Checksum).run(byteArray, []) +
|
"\nFletcher-8: " + (new Fletcher8Checksum).run(byteArray, []) +
|
||||||
"\nFletcher-16: " + (new Fletcher16Checksum).run(byteArray, []) +
|
"\nFletcher-16: " + (new Fletcher16Checksum).run(byteArray, []) +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue