Browse Source

Indicate internal use of getID with an underscore.

patch-2
Braydon Fuller 10 years ago
parent
commit
84cc1a0042
  1. 4
      lib/publickey.js
  2. 2
      test/publickey.js

4
lib/publickey.js

@ -385,12 +385,12 @@ PublicKey.prototype.toBuffer = PublicKey.prototype.toDER = function() {
}
};
/*
/**
* Will return a sha256 + ripemd160 hash of the serialized public key
* @see https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.h#L141
* @returns {Buffer}
*/
PublicKey.prototype.getID = function getID() {
PublicKey.prototype._getID = function _getID() {
return Hash.sha256ripemd160(this.toBuffer());
};

2
test/publickey.js

@ -355,7 +355,7 @@ describe('PublicKey', function() {
data.forEach(function(d){
var publicKey = PrivateKey.fromWIF(d[0]).toPublicKey();
var address = Address.fromString(d[1]);
address.hashBuffer.should.deep.equal(publicKey.getID());
address.hashBuffer.should.deep.equal(publicKey._getID());
});
});

Loading…
Cancel
Save