Indicate internal use of getID with an underscore.

This commit is contained in:
Braydon Fuller 2015-01-09 10:15:48 -05:00
parent 81fa162a7f
commit 84cc1a0042
2 changed files with 3 additions and 3 deletions

View File

@ -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());
};

View File

@ -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());
});
});