Added Snefru hashing operation

This commit is contained in:
n1474335 2017-09-27 15:33:14 +00:00
parent d924da2f25
commit 7557e1e9e5
7 changed files with 115 additions and 4 deletions

View file

@ -294,6 +294,31 @@ const Hash = {
},
/**
* @constant
* @default
*/
SNEFRU_ROUNDS: ["8", "4", "2"],
/**
* @constant
* @default
*/
SNEFRU_SIZE: ["256", "128"],
/**
* Snefru operation.
*
* @param {string} input
* @param {Object[]} args
* @returns {string}
*/
runSnefru: function (input, args) {
const rounds = args[0],
size = args[1];
return CryptoApi.hash(`snefru-${rounds}-${size}`, input, {}).stringify("hex");
},
/**
* @constant
* @default