From 9d73127caeb0d79760193656df10aefcee10690e Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 16 Oct 2019 15:38:20 +0100 Subject: [PATCH] Fixed some typos --- Gruntfile.js | 2 +- src/core/Dish.mjs | 4 ++-- src/core/lib/BCD.mjs | 2 +- src/core/lib/Delim.mjs | 2 +- src/core/lib/FileSignatures.mjs | 2 +- src/core/lib/FileType.mjs | 2 +- src/core/lib/QRCode.mjs | 2 +- src/core/operations/BLAKE2b.mjs | 2 +- src/core/operations/BLAKE2s.mjs | 2 +- src/core/operations/HammingDistance.mjs | 2 +- src/core/operations/RawInflate.mjs | 2 +- src/core/operations/RemoveWhitespace.mjs | 4 ++-- src/core/operations/ToQuotedPrintable.mjs | 2 +- src/core/operations/Typex.mjs | 2 +- src/core/operations/UNIXTimestampToWindowsFiletime.mjs | 2 +- src/core/operations/URLEncode.mjs | 2 +- src/core/operations/VigenèreDecode.mjs | 2 +- src/core/operations/Whirlpool.mjs | 2 +- src/node/api.mjs | 6 +++--- src/node/apiUtils.mjs | 2 +- src/node/config/excludedOperations.mjs | 2 +- src/node/config/scripts/generateNodeIndex.mjs | 4 ++-- src/web/waiters/ControlsWaiter.mjs | 2 +- src/web/waiters/OperationsWaiter.mjs | 2 +- src/web/waiters/OptionsWaiter.mjs | 2 +- src/web/waiters/OutputWaiter.mjs | 2 +- src/web/waiters/WindowWaiter.mjs | 2 +- src/web/waiters/WorkerWaiter.mjs | 2 +- src/web/workers/InputWorker.mjs | 2 +- tests/node/tests/operations.mjs | 2 +- tests/operations/tests/CharEnc.mjs | 2 +- 31 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 92a2d550..42083e26 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -355,7 +355,7 @@ module.exports = function (grunt) { }, setupNodeConsumers: { command: [ - "echo '\n--- Testing node conumers ---'", + "echo '\n--- Testing node consumers ---'", "npm link", `mkdir ${nodeConsumerTestPath}`, `cp tests/node/consumers/* ${nodeConsumerTestPath}`, diff --git a/src/core/Dish.mjs b/src/core/Dish.mjs index 64bdf3fb..1d592cbd 100755 --- a/src/core/Dish.mjs +++ b/src/core/Dish.mjs @@ -129,7 +129,7 @@ class Dish { * * @param {number} type - The data type of value, see Dish enums. * @param {boolean} [notUTF8=false] - Do not treat strings as UTF8. - * @returns {* | Promise} - (Broswer) A promise | (Node) value of dish in given type + * @returns {* | Promise} - (Browser) A promise | (Node) value of dish in given type */ get(type, notUTF8=false) { if (typeof type === "string") { @@ -191,7 +191,7 @@ class Dish { * * @param {number} type - The data type of value, see Dish enums. * @param {boolean} [notUTF8=false] - Do not treat strings as UTF8. - * @returns {Dish | Promise} - (Broswer) A promise | (Node) value of dish in given type + * @returns {Dish | Promise} - (Browser) A promise | (Node) value of dish in given type */ presentAs(type, notUTF8=false) { const clone = this.clone(); diff --git a/src/core/lib/BCD.mjs b/src/core/lib/BCD.mjs index 623a90c7..2f245236 100644 --- a/src/core/lib/BCD.mjs +++ b/src/core/lib/BCD.mjs @@ -22,7 +22,7 @@ export const ENCODING_SCHEME = [ /** * Lookup table for the binary value of each digit representation. * - * I wrote a very nice algorithm to generate 8 4 2 1 encoding programatically, + * I wrote a very nice algorithm to generate 8 4 2 1 encoding programmatically, * but unfortunately it's much easier (if less elegant) to use lookup tables * when supporting multiple encoding schemes. * diff --git a/src/core/lib/Delim.mjs b/src/core/lib/Delim.mjs index 0a7193c6..c8cc637b 100644 --- a/src/core/lib/Delim.mjs +++ b/src/core/lib/Delim.mjs @@ -32,7 +32,7 @@ export const WORD_DELIM_OPTIONS = ["Line feed", "CRLF", "Forward slash", "Backsl export const INPUT_DELIM_OPTIONS = ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"]; /** - * Armithmetic sequence delimiters + * Arithmetic sequence delimiters */ export const ARITHMETIC_DELIM_OPTIONS = ["Line feed", "Space", "Comma", "Semi-colon", "Colon", "CRLF"]; diff --git a/src/core/lib/FileSignatures.mjs b/src/core/lib/FileSignatures.mjs index 40eacff4..a6efb320 100644 --- a/src/core/lib/FileSignatures.mjs +++ b/src/core/lib/FileSignatures.mjs @@ -2463,7 +2463,7 @@ export function extractMZPE(bytes, offset) { const numSections = stream.readInt(2, "le"); // Read Optional Header Magic to determine the state of the image file - // 0x10b = normal exeuctable, 0x107 = ROM image, 0x20b = PE32+ executable + // 0x10b = normal executable, 0x107 = ROM image, 0x20b = PE32+ executable stream.moveForwardsBy(16); const optionalMagic = stream.readInt(2, "le"); const pe32Plus = optionalMagic === 0x20b; diff --git a/src/core/lib/FileType.mjs b/src/core/lib/FileType.mjs index dc6cc973..291760d7 100644 --- a/src/core/lib/FileType.mjs +++ b/src/core/lib/FileType.mjs @@ -178,7 +178,7 @@ export function scanForFileTypes(buf, categories=Object.keys(FILE_SIGNATURES)) { * @param {Uint8Array} buf - The buffer to search * @param {Object} sig - A single signature object (Not an array of signatures) * @param {number} offset - Where to start search from - * @returs {number} The position of the match or -1 if one cannot be found. + * @returns {number} The position of the match or -1 if one cannot be found. */ function locatePotentialSig(buf, sig, offset) { // Find values for first key and value in sig diff --git a/src/core/lib/QRCode.mjs b/src/core/lib/QRCode.mjs index 1585cb41..041c21f7 100644 --- a/src/core/lib/QRCode.mjs +++ b/src/core/lib/QRCode.mjs @@ -37,7 +37,7 @@ export async function parseQrCode(input, normalise) { image = await jimp.read(image); } } catch (err) { - throw new OperationError(`Error normalising iamge. (${err})`); + throw new OperationError(`Error normalising image. (${err})`); } const qrData = jsQR(image.bitmap.data, image.getWidth(), image.getHeight()); diff --git a/src/core/operations/BLAKE2b.mjs b/src/core/operations/BLAKE2b.mjs index 113cbaf3..6218f7f0 100644 --- a/src/core/operations/BLAKE2b.mjs +++ b/src/core/operations/BLAKE2b.mjs @@ -50,7 +50,7 @@ class BLAKE2b extends Operation { /** * @param {ArrayBuffer} input * @param {Object[]} args - * @returns {string} The input having been hashed with BLAKE2b in the encoding format speicifed. + * @returns {string} The input having been hashed with BLAKE2b in the encoding format specified. */ run(input, args) { const [outSize, outFormat] = args; diff --git a/src/core/operations/BLAKE2s.mjs b/src/core/operations/BLAKE2s.mjs index 36015607..8f84e041 100644 --- a/src/core/operations/BLAKE2s.mjs +++ b/src/core/operations/BLAKE2s.mjs @@ -51,7 +51,7 @@ class BLAKE2s extends Operation { /** * @param {ArrayBuffer} input * @param {Object[]} args - * @returns {string} The input having been hashed with BLAKE2s in the encoding format speicifed. + * @returns {string} The input having been hashed with BLAKE2s in the encoding format specified. */ run(input, args) { const [outSize, outFormat] = args; diff --git a/src/core/operations/HammingDistance.mjs b/src/core/operations/HammingDistance.mjs index fb60f940..60121a75 100644 --- a/src/core/operations/HammingDistance.mjs +++ b/src/core/operations/HammingDistance.mjs @@ -57,7 +57,7 @@ class HammingDistance extends Operation { samples = input.split(delim); if (samples.length !== 2) { - throw new OperationError("Error: You can only calculae the edit distance between 2 strings. Please ensure exactly two inputs are provided, separated by the specified delimiter."); + throw new OperationError("Error: You can only calculate the edit distance between 2 strings. Please ensure exactly two inputs are provided, separated by the specified delimiter."); } if (samples[0].length !== samples[1].length) { diff --git a/src/core/operations/RawInflate.mjs b/src/core/operations/RawInflate.mjs index d676ff1e..f8a938c5 100644 --- a/src/core/operations/RawInflate.mjs +++ b/src/core/operations/RawInflate.mjs @@ -77,7 +77,7 @@ class RawInflate extends Operation { }), result = new Uint8Array(inflate.decompress()); - // Raw Inflate somethimes messes up and returns nonsense like this: + // Raw Inflate sometimes messes up and returns nonsense like this: // ]....]....]....]....]....]....]....]....]....]....]....]....]....]... // e.g. Input data of [8b, 1d, dc, 44] // Look for the first two square brackets: diff --git a/src/core/operations/RemoveWhitespace.mjs b/src/core/operations/RemoveWhitespace.mjs index a9ceda81..0689f766 100644 --- a/src/core/operations/RemoveWhitespace.mjs +++ b/src/core/operations/RemoveWhitespace.mjs @@ -64,7 +64,7 @@ class RemoveWhitespace extends Operation { run(input, args) { const [ removeSpaces, - removeCariageReturns, + removeCarriageReturns, removeLineFeeds, removeTabs, removeFormFeeds, @@ -73,7 +73,7 @@ class RemoveWhitespace extends Operation { let data = input; if (removeSpaces) data = data.replace(/ /g, ""); - if (removeCariageReturns) data = data.replace(/\r/g, ""); + if (removeCarriageReturns) data = data.replace(/\r/g, ""); if (removeLineFeeds) data = data.replace(/\n/g, ""); if (removeTabs) data = data.replace(/\t/g, ""); if (removeFormFeeds) data = data.replace(/\f/g, ""); diff --git a/src/core/operations/ToQuotedPrintable.mjs b/src/core/operations/ToQuotedPrintable.mjs index e26f3c67..9db5c5a5 100644 --- a/src/core/operations/ToQuotedPrintable.mjs +++ b/src/core/operations/ToQuotedPrintable.mjs @@ -108,7 +108,7 @@ class ToQuotedPrintable extends Operation { * @private * @param {number} nr * @param {byteArray[]} ranges - * @returns {bolean} + * @returns {boolean} */ _checkRanges(nr, ranges) { for (let i = ranges.length - 1; i >= 0; i--) { diff --git a/src/core/operations/Typex.mjs b/src/core/operations/Typex.mjs index a9b7a3d0..8b81c13f 100644 --- a/src/core/operations/Typex.mjs +++ b/src/core/operations/Typex.mjs @@ -23,7 +23,7 @@ class Typex extends Operation { this.name = "Typex"; this.module = "Default"; - this.description = "Encipher/decipher with the WW2 Typex machine.

Typex was originally built by the British Royal Air Force prior to WW2, and is based on the Enigma machine with some improvements made, including using five rotors with more stepping points and interchangeable wiring cores. It was used across the British and Commonewealth militaries. A number of later variants were produced; here we simulate a WW2 era Mark 22 Typex with plugboards for the reflector and input. Typex rotors were changed regularly and none are public: a random example set are provided.

To configure the reflector plugboard, enter a string of connected pairs of letters in the reflector box, e.g. AB CD EF connects A to B, C to D, and E to F (you'll need to connect every letter). There is also an input plugboard: unlike Enigma's plugboard, it's not restricted to pairs, so it's entered like a rotor (without stepping). To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by < then a list of stepping points.

More detailed descriptions of the Enigma, Typex and Bombe operations can be found here."; + this.description = "Encipher/decipher with the WW2 Typex machine.

Typex was originally built by the British Royal Air Force prior to WW2, and is based on the Enigma machine with some improvements made, including using five rotors with more stepping points and interchangeable wiring cores. It was used across the British and Commonwealth militaries. A number of later variants were produced; here we simulate a WW2 era Mark 22 Typex with plugboards for the reflector and input. Typex rotors were changed regularly and none are public: a random example set are provided.

To configure the reflector plugboard, enter a string of connected pairs of letters in the reflector box, e.g. AB CD EF connects A to B, C to D, and E to F (you'll need to connect every letter). There is also an input plugboard: unlike Enigma's plugboard, it's not restricted to pairs, so it's entered like a rotor (without stepping). To create your own rotor, enter the letters that the rotor maps A to Z to, in order, optionally followed by < then a list of stepping points.

More detailed descriptions of the Enigma, Typex and Bombe operations can be found here."; this.infoURL = "https://wikipedia.org/wiki/Typex"; this.inputType = "string"; this.outputType = "string"; diff --git a/src/core/operations/UNIXTimestampToWindowsFiletime.mjs b/src/core/operations/UNIXTimestampToWindowsFiletime.mjs index 5a042885..c87f3507 100644 --- a/src/core/operations/UNIXTimestampToWindowsFiletime.mjs +++ b/src/core/operations/UNIXTimestampToWindowsFiletime.mjs @@ -56,7 +56,7 @@ class UNIXTimestampToWindowsFiletime extends Operation { } else if (units === "Milliseconds (ms)") { input = input.multipliedBy(new BigNumber("10000")); } else if (units === "Microseconds (μs)") { - input = input.multiplyiedBy(new BigNumber("10")); + input = input.multipliedBy(new BigNumber("10")); } else if (units === "Nanoseconds (ns)") { input = input.dividedBy(new BigNumber("100")); } else { diff --git a/src/core/operations/URLEncode.mjs b/src/core/operations/URLEncode.mjs index f819ee2e..a5efd213 100644 --- a/src/core/operations/URLEncode.mjs +++ b/src/core/operations/URLEncode.mjs @@ -49,7 +49,7 @@ class URLEncode extends Operation { * @returns {string} */ encodeAllChars (str) { - // TODO Do this programatically + // TODO Do this programmatically return encodeURIComponent(str) .replace(/!/g, "%21") .replace(/#/g, "%23") diff --git a/src/core/operations/VigenèreDecode.mjs b/src/core/operations/VigenèreDecode.mjs index 90cca3f8..8abaeed8 100644 --- a/src/core/operations/VigenèreDecode.mjs +++ b/src/core/operations/VigenèreDecode.mjs @@ -55,7 +55,7 @@ class VigenèreDecode extends Operation { keyIndex = alphabet.indexOf(chr); msgIndex = alphabet.indexOf(input[i]); // Subtract indexes from each other, add 26 just in case the value is negative, - // modulo to remove if neccessary + // modulo to remove if necessary output += alphabet[(msgIndex - keyIndex + alphabet.length) % 26]; } else if (alphabet.indexOf(input[i].toLowerCase()) >= 0) { chr = key[(i - fail) % key.length].toLowerCase(); diff --git a/src/core/operations/Whirlpool.mjs b/src/core/operations/Whirlpool.mjs index 0e1c51ab..ae4c0359 100644 --- a/src/core/operations/Whirlpool.mjs +++ b/src/core/operations/Whirlpool.mjs @@ -20,7 +20,7 @@ class Whirlpool extends Operation { this.name = "Whirlpool"; this.module = "Crypto"; - this.description = "Whirlpool is a cryptographic hash function designed by Vincent Rijmen (co-creator of AES) and Paulo S. L. M. Barreto, who first described it in 2000.

Several variants exist:"; + this.description = "Whirlpool is a cryptographic hash function designed by Vincent Rijmen (co-creator of AES) and Paulo S. L. M. Barreto, who first described it in 2000.

Several variants exist:"; this.infoURL = "https://wikipedia.org/wiki/Whirlpool_(cryptography)"; this.inputType = "ArrayBuffer"; this.outputType = "string"; diff --git a/src/node/api.mjs b/src/node/api.mjs index f03d45b6..fca29dd8 100644 --- a/src/node/api.mjs +++ b/src/node/api.mjs @@ -12,7 +12,7 @@ import NodeDish from "./NodeDish.mjs"; import NodeRecipe from "./NodeRecipe.mjs"; import OperationConfig from "../core/config/OperationConfig.json"; import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs"; -import ExludedOperationError from "../core/errors/ExcludedOperationError.mjs"; +import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs"; /** @@ -320,12 +320,12 @@ export function bake() { * Explain that the given operation is not included in the Node.js version. * @param {String} name - name of operation */ -export function _explainExludedFunction(name) { +export function _explainExcludedFunction(name) { /** * Throw new error type with useful message. */ const func = () => { - throw new ExludedOperationError(`Sorry, the ${name} operation is not available in the Node.js version of CyberChef.`); + throw new ExcludedOperationError(`Sorry, the ${name} operation is not available in the Node.js version of CyberChef.`); }; // Add opName prop so NodeRecipe can handle it, just like wrap does. func.opName = name; diff --git a/src/node/apiUtils.mjs b/src/node/apiUtils.mjs index 8d530083..64688073 100644 --- a/src/node/apiUtils.mjs +++ b/src/node/apiUtils.mjs @@ -71,7 +71,7 @@ export function sanitise(str) { /** - * sonething like this => somethingLikeThis + * something like this => somethingLikeThis * ABC a sentence => ABCASentence */ export function sentenceToCamelCase(str) { diff --git a/src/node/config/excludedOperations.mjs b/src/node/config/excludedOperations.mjs index f9873eaf..9359475d 100644 --- a/src/node/config/excludedOperations.mjs +++ b/src/node/config/excludedOperations.mjs @@ -1,5 +1,5 @@ /** - * Operations to exlude from the Node API + * Operations to exclude from the Node API * * @author d98762656 [d98762625@gmail.com] * @copyright Crown Copyright 2018 diff --git a/src/node/config/scripts/generateNodeIndex.mjs b/src/node/config/scripts/generateNodeIndex.mjs index 391cd6e9..b65b7d3c 100644 --- a/src/node/config/scripts/generateNodeIndex.mjs +++ b/src/node/config/scripts/generateNodeIndex.mjs @@ -39,7 +39,7 @@ let code = `/** import NodeDish from "./NodeDish.mjs"; -import { _wrap, help, bake, _explainExludedFunction } from "./api.mjs"; +import { _wrap, help, bake, _explainExcludedFunction } from "./api.mjs"; import File from "./File.mjs"; import { OperationError, DishError, ExcludedOperationError } from "../core/errors/index"; import { @@ -70,7 +70,7 @@ includedOperations.forEach((op) => { }); excludedOperations.forEach((op) => { - code += ` "${decapitalise(op)}": _explainExludedFunction("${op}"),\n`; + code += ` "${decapitalise(op)}": _explainExcludedFunction("${op}"),\n`; }); code += ` }; diff --git a/src/web/waiters/ControlsWaiter.mjs b/src/web/waiters/ControlsWaiter.mjs index 3dd014b6..2f2705aa 100755 --- a/src/web/waiters/ControlsWaiter.mjs +++ b/src/web/waiters/ControlsWaiter.mjs @@ -25,7 +25,7 @@ class ControlsWaiter { /** - * Initialise Bootstrap componenets + * Initialise Bootstrap components */ initComponents() { $("body").bootstrapMaterialDesign(); diff --git a/src/web/waiters/OperationsWaiter.mjs b/src/web/waiters/OperationsWaiter.mjs index 19adba9f..4a591249 100755 --- a/src/web/waiters/OperationsWaiter.mjs +++ b/src/web/waiters/OperationsWaiter.mjs @@ -172,7 +172,7 @@ class OperationsWaiter { $(el).find("[data-toggle=popover]").addBack("[data-toggle=popover]") .popover({trigger: "manual"}) .on("mouseenter", function(e) { - if (e.buttons > 0) return; // Mouse button held down - likely dragging an opertion + if (e.buttons > 0) return; // Mouse button held down - likely dragging an operation const _this = this; $(this).popover("show"); $(".popover").on("mouseleave", function () { diff --git a/src/web/waiters/OptionsWaiter.mjs b/src/web/waiters/OptionsWaiter.mjs index 3dde372d..a19c6066 100755 --- a/src/web/waiters/OptionsWaiter.mjs +++ b/src/web/waiters/OptionsWaiter.mjs @@ -58,7 +58,7 @@ class OptionsWaiter { /** * Handler for options click events. - * Dispays the options pane. + * Displays the options pane. * * @param {event} e */ diff --git a/src/web/waiters/OutputWaiter.mjs b/src/web/waiters/OutputWaiter.mjs index 833922b8..11a78254 100755 --- a/src/web/waiters/OutputWaiter.mjs +++ b/src/web/waiters/OutputWaiter.mjs @@ -174,7 +174,7 @@ class OutputWaiter { } /** - * Updates the stored bake ID for the output in the ouptut array + * Updates the stored bake ID for the output in the output array * * @param {number} bakeId * @param {number} inputNum diff --git a/src/web/waiters/WindowWaiter.mjs b/src/web/waiters/WindowWaiter.mjs index cee2feec..b22a5013 100755 --- a/src/web/waiters/WindowWaiter.mjs +++ b/src/web/waiters/WindowWaiter.mjs @@ -33,7 +33,7 @@ class WindowWaiter { /** * Handler for window blur events. - * Saves the current time so that we can calculate how long the window was unfocussed for when + * Saves the current time so that we can calculate how long the window was unfocused for when * focus is returned. */ windowBlur() { diff --git a/src/web/waiters/WorkerWaiter.mjs b/src/web/waiters/WorkerWaiter.mjs index 877c0e02..55f51406 100644 --- a/src/web/waiters/WorkerWaiter.mjs +++ b/src/web/waiters/WorkerWaiter.mjs @@ -353,7 +353,7 @@ class WorkerWaiter { * @param {object} workerObj - Object containing the worker information * @param {ChefWorker} workerObj.worker - The actual worker object * @param {number} workerObj.inputNum - The inputNum of the input being baked by the worker - * @param {boolean} workerObj.active - If true, the worker is currrently baking an input + * @param {boolean} workerObj.active - If true, the worker is currently baking an input */ workerFinished(workerObj) { const workerIdx = this.chefWorkers.indexOf(workerObj); diff --git a/src/web/workers/InputWorker.mjs b/src/web/workers/InputWorker.mjs index 521539c5..9912995b 100644 --- a/src/web/workers/InputWorker.mjs +++ b/src/web/workers/InputWorker.mjs @@ -945,7 +945,7 @@ self.updateMaxTabs = function(maxTabs, activeTab) { * @param {boolean} searchData.showLoading - If true, include loading inputs in the results * @param {boolean} searchData.showLoaded - If true, include loaded inputs in the results * @param {string} searchData.filter - A regular expression to match the inputs on - * @param {string} searchData.filterType - Either "CONTENT" or "FILENAME". Detemines what should be matched with filter + * @param {string} searchData.filterType - Either "CONTENT" or "FILENAME". Determines what should be matched with filter * @param {number} searchData.numResults - The maximum number of results to be returned */ self.filterTabs = function(searchData) { diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index 8337c48d..81af9593 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -1028,7 +1028,7 @@ ExifImageHeight: 57`); const zipped = chef.zip("some file content", { filename: "sample.zip", comment: "added", - operaringSystem: "Unix", + operatingSystem: "Unix", }); assert.strictEqual(zipped.type, 7); diff --git a/tests/operations/tests/CharEnc.mjs b/tests/operations/tests/CharEnc.mjs index 552d31b3..1bd18d76 100644 --- a/tests/operations/tests/CharEnc.mjs +++ b/tests/operations/tests/CharEnc.mjs @@ -69,7 +69,7 @@ TestRegister.addTests([ ], }, { - name: "Generate Base64 Windows Powershell", + name: "Generate Base64 Windows PowerShell", input: "ZABpAHIAIAAiAGMAOgBcAHAAcgBvAGcAcgBhAG0AIABmAGkAbABlAHMAIgAgAA==", expectedOutput: "dir \"c:\\program files\" ", recipeConfig: [