ESM: Ported all Hash and Checksum operations
This commit is contained in:
1 parent
5362508a99
commit
3fd1f4e6d9
43 files changed
+1971
-9
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2016
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
import {runHash} from "../lib/Hash";
|
||||
|
||||
/**
|
||||
* MD5 operation
|
||||
*/
|
||||
class MD5 extends Operation {
|
||||
|
||||
/**
|
||||
* MD5 constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "MD5";
|
||||
this.module = "Hashing";
|
||||
this.description = "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.<br><br>However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.";
|
||||
this.inputType = "ArrayBuffer";
|
||||
this.outputType = "string";
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ArrayBuffer} input
|
||||
* @param {Object[]} args
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
return runHash("md5", input);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MD5;
|
||||
Reference in new issue
Block a user