Comparing version 1.2.1 to 1.3.0
@@ -54,2 +54,4 @@ 'use strict'; | ||
exports.createHash = exports.makeHasher; | ||
/** | ||
@@ -70,7 +72,18 @@ * Get md5 hash digests of data | ||
*/ | ||
exports.sha1 = function (data, key, encoding) { | ||
return crypto.createHmac('sha1', key).update(data).digest(encoding); | ||
exports.createHmac = function (algorithm) { | ||
return function (data, key, encoding) { | ||
return crypto.createHmac(algorithm, key).update(data).digest(encoding); | ||
}; | ||
}; | ||
/** | ||
* Get sha1 hash digests of data | ||
* @param {String|Buffer} data data. | ||
* @param {String} key the key. | ||
* @param {String} encoding optionnal. can be 'hex', 'binary', 'base64'. | ||
* @return {String|Buffer} if no encoding is provided, a buffer is returned. | ||
*/ | ||
exports.sha1 = exports.createHmac('sha1'); | ||
/** | ||
* Get a random value in a range | ||
@@ -77,0 +90,0 @@ * @param {Number} min range start. |
{ | ||
"name": "kitx", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "toolkit", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8059
191