From 525f42dcc13508fe213fe0bb704f206493eff7cc Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Tue, 29 Oct 2019 14:32:28 +0300 Subject: [PATCH] Delete Fletcher16Checksum.mjs --- src/core/operations/Fletcher16Checksum.mjs | 50 ---------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/core/operations/Fletcher16Checksum.mjs diff --git a/src/core/operations/Fletcher16Checksum.mjs b/src/core/operations/Fletcher16Checksum.mjs deleted file mode 100644 index b91ec2a8..00000000 --- a/src/core/operations/Fletcher16Checksum.mjs +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @author n1474335 [n1474335@gmail.com] - * @copyright Crown Copyright 2016 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import Utils from "../Utils.mjs"; - -/** - * Fletcher-16 Checksum operation - */ -class Fletcher16Checksum extends Operation { - - /** - * Fletcher16Checksum constructor - */ - constructor() { - super(); - - this.name = "Fletcher-16 Checksum"; - this.module = "Crypto"; - this.description = "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques."; - this.infoURL = "https://wikipedia.org/wiki/Fletcher%27s_checksum#Fletcher-16"; - this.inputType = "ArrayBuffer"; - this.outputType = "string"; - this.args = []; - } - - /** - * @param {ArrayBuffer} input - * @param {Object[]} args - * @returns {string} - */ - run(input, args) { - let a = 0, - b = 0; - input = new Uint8Array(input); - - for (let i = 0; i < input.length; i++) { - a = (a + input[i]) % 0xff; - b = (b + a) % 0xff; - } - - return Utils.hex(((b << 8) | a) >>> 0, 4); - } - -} - -export default Fletcher16Checksum;