diff options
Diffstat (limited to 'node_modules/create-hash/browser.js')
-rw-r--r-- | node_modules/create-hash/browser.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/node_modules/create-hash/browser.js b/node_modules/create-hash/browser.js index e9add1e94..56a46d88f 100644 --- a/node_modules/create-hash/browser.js +++ b/node_modules/create-hash/browser.js @@ -1,12 +1,12 @@ -'use strict'; +'use strict' var inherits = require('inherits') var md5 = require('./md5') -var rmd160 = require('ripemd160') +var RIPEMD160 = require('ripemd160') var sha = require('sha.js') var Base = require('cipher-base') -function HashNoConstructor(hash) { +function HashNoConstructor (hash) { Base.call(this, 'digest') this._hash = hash @@ -27,7 +27,7 @@ HashNoConstructor.prototype._final = function () { return r } -function Hash(hash) { +function Hash (hash) { Base.call(this, 'digest') this._hash = hash @@ -45,8 +45,8 @@ Hash.prototype._final = function () { module.exports = function createHash (alg) { alg = alg.toLowerCase() - if ('md5' === alg) return new HashNoConstructor(md5) - if ('rmd160' === alg || 'ripemd160' === alg) return new HashNoConstructor(rmd160) + if (alg === 'md5') return new HashNoConstructor(md5) + if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160()) return new Hash(sha(alg)) } |