From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/create-hash/browser.js | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'node_modules/create-hash/browser.js') diff --git a/node_modules/create-hash/browser.js b/node_modules/create-hash/browser.js index 56a46d88f..01841bb9b 100644 --- a/node_modules/create-hash/browser.js +++ b/node_modules/create-hash/browser.js @@ -1,32 +1,10 @@ 'use strict' var inherits = require('inherits') -var md5 = require('./md5') +var MD5 = require('md5.js') var RIPEMD160 = require('ripemd160') var sha = require('sha.js') - var Base = require('cipher-base') -function HashNoConstructor (hash) { - Base.call(this, 'digest') - - this._hash = hash - this.buffers = [] -} - -inherits(HashNoConstructor, Base) - -HashNoConstructor.prototype._update = function (data) { - this.buffers.push(data) -} - -HashNoConstructor.prototype._final = function () { - var buf = Buffer.concat(this.buffers) - var r = this._hash(buf) - this.buffers = null - - return r -} - function Hash (hash) { Base.call(this, 'digest') @@ -45,8 +23,8 @@ Hash.prototype._final = function () { module.exports = function createHash (alg) { alg = alg.toLowerCase() - if (alg === 'md5') return new HashNoConstructor(md5) - if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160()) + if (alg === 'md5') return new MD5() + if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160() return new Hash(sha(alg)) } -- cgit v1.2.3