Added MD6 operation. Closes #53

This commit is contained in:
n1474335 2017-09-12 14:20:05 +00:00
parent f1fe0b944f
commit a736be7ca8
5 changed files with 83 additions and 20 deletions

View file

@ -1,6 +1,7 @@
import Utils from "../Utils.js";
import CryptoJS from "crypto-js";
import CryptoApi from "crypto-api";
import MD6 from "node-md6";
import Checksum from "./Checksum.js";
@ -52,6 +53,38 @@ const Hash = {
},
/**
* @constant
* @default
*/
MD6_SIZE: 256,
/**
* @constant
* @default
*/
MD6_LEVELS: 64,
/**
* MD6 operation.
*
* @param {string} input
* @param {Object[]} args
* @returns {string}
*/
runMD6: function (input, args) {
const size = args[0],
levels = args[1],
key = args[2];
if (size < 0 || size > 512)
return "Size must be between 0 and 512";
if (levels < 0)
return "Levels must be greater than 0";
return MD6.getHashOfText(input, size, key, levels);
},
/**
* SHA0 operation.
*