mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
ESM: Ported all Hash and Checksum operations
This commit is contained in:
parent
5362508a99
commit
3fd1f4e6d9
43 changed files with 1971 additions and 9 deletions
40
src/core/operations/MD5.mjs
Normal file
40
src/core/operations/MD5.mjs
Normal file
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue