ESM: Ported all Hash and Checksum operations

This commit is contained in:
n1474335 2018-05-17 15:11:34 +00:00
parent 5362508a99
commit 3fd1f4e6d9
43 changed files with 1971 additions and 9 deletions

View file

@ -0,0 +1,47 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Operation from "../Operation";
import {runHash} from "../lib/Hash";
/**
* RIPEMD operation
*/
class RIPEMD extends Operation {
/**
* RIPEMD constructor
*/
constructor() {
super();
this.name = "RIPEMD";
this.module = "Hashing";
this.description = "RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.<br><br>RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.<br><br>";
this.inputType = "ArrayBuffer";
this.outputType = "string";
this.args = [
{
"name": "Size",
"type": "option",
"value": ["320", "256", "160", "128"]
}
];
}
/**
* @param {ArrayBuffer} input
* @param {Object[]} args
* @returns {string}
*/
run(input, args) {
const size = args[0];
return runHash("ripemd" + size, input);
}
}
export default RIPEMD;