diff --git a/package.json b/package.json index 5e38867..6ca9fb8 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "url": "https://github.com/bitcoinjs/bitcoinjs-lib.git" }, "devDependencies": { - "browserify": "~4.1.5", + "browserify": "4.1.11", "coveralls": "~2.10.0", "helloblock-js": "^0.2.1", "istanbul": "0.1.30", @@ -68,9 +68,13 @@ "test": "npm run-script unit", "unit": "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha -- --reporter list `find test -maxdepth 1 -not -type d`" }, + "browser": { + "crypto": "crypto-browserify" + }, "dependencies": { "bigi": "1.1.0", "crypto-js": "3.1.2-3", + "crypto-browserify": "2.1.8", "ecurve": "0.10.0", "secure-random": "0.2.1" } diff --git a/src/crypto.js b/src/crypto.js index 87eccf1..1c8423b 100644 --- a/src/crypto.js +++ b/src/crypto.js @@ -13,10 +13,7 @@ function hash256(buffer) { } function ripemd160(buffer) { - var array = convert.bufferToWordArray(buffer) - var result = CryptoJS.RIPEMD160(array) - - return convert.wordArrayToBuffer(result) + return crypto.createHash('rmd160').update(buffer).digest() } function sha1(buffer) {