Merge pull request #60 from braydonf/sha512

crypto: switch to Node.js sha512
This commit is contained in:
Matias Alejo Garcia 2016-05-23 16:13:17 -03:00
commit 09893632c2
3 changed files with 2 additions and 10 deletions

View File

@ -1,6 +1,5 @@
'use strict';
var sha512 = require('sha512');
var crypto = require('crypto');
var BufferUtil = require('../util/buffer');
var $ = require('../util/preconditions');
@ -38,8 +37,7 @@ Hash.sha256ripemd160 = function(buf) {
Hash.sha512 = function(buf) {
$.checkArgument(BufferUtil.isBuffer(buf));
var hash = sha512(buf);
return new Buffer(hash);
return crypto.createHash('sha512').update(buf).digest();
};
Hash.sha512.blocksize = 1024;

5
npm-shrinkwrap.json generated
View File

@ -43,11 +43,6 @@
"version": "3.10.1",
"from": "lodash@=3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
},
"sha512": {
"version": "0.0.1",
"from": "sha512@=0.0.1",
"resolved": "https://registry.npmjs.org/sha512/-/sha512-0.0.1.tgz"
}
}
}

View File

@ -85,8 +85,7 @@
"buffer-compare": "=1.0.0",
"elliptic": "=3.0.3",
"inherits": "=2.0.1",
"lodash": "=3.10.1",
"sha512": "=0.0.1"
"lodash": "=3.10.1"
},
"devDependencies": {
"bitcore-build": "bitpay/bitcore-build",