We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
crypto.hash()
crypto.createHash().update().digest()
1 parent b638139 commit 94d4abfCopy full SHA for 94d4abf
index.js
@@ -5,6 +5,9 @@ exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = r
5
6
// eslint-disable-next-line no-multi-assign
7
exports.createHash = exports.Hash = require('create-hash');
8
+exports.hash = function (algorithm, data, outputEncoding) {
9
+ return exports.createHash(algorithm).update(data).digest(outputEncoding || 'hex');
10
+};
11
12
13
exports.createHmac = exports.Hmac = require('create-hmac');
0 commit comments