Browse Source

crypto: use latest crypto-browserify

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
f0370ef46f
  1. 6
      package.json
  2. 5
      src/crypto.js

6
package.json

@ -36,7 +36,7 @@
"url": "https://github.com/bitcoinjs/bitcoinjs-lib.git" "url": "https://github.com/bitcoinjs/bitcoinjs-lib.git"
}, },
"devDependencies": { "devDependencies": {
"browserify": "~4.1.5", "browserify": "4.1.11",
"coveralls": "~2.10.0", "coveralls": "~2.10.0",
"helloblock-js": "^0.2.1", "helloblock-js": "^0.2.1",
"istanbul": "0.1.30", "istanbul": "0.1.30",
@ -68,9 +68,13 @@
"test": "npm run-script unit", "test": "npm run-script unit",
"unit": "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha -- --reporter list `find test -maxdepth 1 -not -type d`" "unit": "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha -- --reporter list `find test -maxdepth 1 -not -type d`"
}, },
"browser": {
"crypto": "crypto-browserify"
},
"dependencies": { "dependencies": {
"bigi": "1.1.0", "bigi": "1.1.0",
"crypto-js": "3.1.2-3", "crypto-js": "3.1.2-3",
"crypto-browserify": "2.1.8",
"ecurve": "0.10.0", "ecurve": "0.10.0",
"secure-random": "0.2.1" "secure-random": "0.2.1"
} }

5
src/crypto.js

@ -13,10 +13,7 @@ function hash256(buffer) {
} }
function ripemd160(buffer) { function ripemd160(buffer) {
var array = convert.bufferToWordArray(buffer) return crypto.createHash('rmd160').update(buffer).digest()
var result = CryptoJS.RIPEMD160(array)
return convert.wordArrayToBuffer(result)
} }
function sha1(buffer) { function sha1(buffer) {

Loading…
Cancel
Save