From 263a98845ed72809df61f5ff70f408a2d4e08ad2 Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Mon, 28 Oct 2019 09:01:49 +0300 Subject: [PATCH] Delete BcryptCompare.mjs --- src/core/operations/BcryptCompare.mjs | 58 --------------------------- 1 file changed, 58 deletions(-) delete mode 100644 src/core/operations/BcryptCompare.mjs diff --git a/src/core/operations/BcryptCompare.mjs b/src/core/operations/BcryptCompare.mjs deleted file mode 100644 index 8d9a6937..00000000 --- a/src/core/operations/BcryptCompare.mjs +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author n1474335 [n1474335@gmail.com] - * @copyright Crown Copyright 2016 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import bcrypt from "bcryptjs"; -import { isWorkerEnvironment } from "../Utils.mjs"; - - -/** - * Bcrypt compare operation - */ -class BcryptCompare extends Operation { - - /** - * BcryptCompare constructor - */ - constructor() { - super(); - - this.name = "Bcrypt compare"; - this.module = "Crypto"; - this.description = "Tests whether the input matches the given bcrypt hash. To test multiple possible passwords, use the 'Fork' operation."; - this.infoURL = "https://wikipedia.org/wiki/Bcrypt"; - this.inputType = "string"; - this.outputType = "string"; - this.args = [ - { - "name": "Hash", - "type": "string", - "value": "" - } - ]; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {string} - */ - async run(input, args) { - const hash = args[0]; - - const match = await bcrypt.compare(input, hash, null, p => { - // Progress callback - if (isWorkerEnvironment()) - self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`); - }); - - return match ? "Match: " + input : "No match"; - - } - -} - -export default BcryptCompare;