From ca4131ab05bbdb1cb17fd744345cb81973fc1202 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Wed, 6 Aug 2014 19:06:32 -0700 Subject: [PATCH] remove ripemd160 dep., replace with hash.js --- index.js | 1 - lib/hash.js | 3 +-- package.json | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/index.js b/index.js index 614b38496..6a2b33670 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,6 @@ privsec.deps.bs58 = require('bs58'); privsec.deps.elliptic = require('elliptic'); privsec.deps.hashjs = require('hash.js'); privsec.deps.sha512 = require('sha512'); -privsec.deps.ripemd160 = require('ripemd160'); privsec.address = require('./lib/address'); privsec.base58 = require('./lib/base58'); diff --git a/lib/hash.js b/lib/hash.js index 4219f8616..f02d570cb 100644 --- a/lib/hash.js +++ b/lib/hash.js @@ -1,6 +1,5 @@ var hashjs = require('hash.js'); var sha512 = require('sha512'); -var ripemd160 = require('ripemd160'); var Hash = module.exports; @@ -22,7 +21,7 @@ Hash.sha256sha256 = function(buf) { Hash.ripemd160 = function(buf) { if (!Buffer.isBuffer(buf)) throw new Error('ripemd160 hash must be of a buffer'); - var hash = ripemd160(buf); + var hash = (new hashjs.ripemd160()).update(buf).digest(); return new Buffer(hash); }; diff --git a/package.json b/package.json index 7b8b67a76..7d56d18ec 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "bs58": "=1.2.1", "elliptic": "=0.15.7", "hash.js": "=0.3.1", - "ripemd160": "=0.2.0", "sha512": "=0.0.1" }, "devDependencies": {