diff --git a/lib/publickey.js b/lib/publickey.js index 0ce572ccb..6977e1c5f 100644 --- a/lib/publickey.js +++ b/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()); }; diff --git a/test/publickey.js b/test/publickey.js index 3843f5de7..f778b5ca9 100644 --- a/test/publickey.js +++ b/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()); }); });