Indicate internal use of getID with an underscore.
This commit is contained in:
parent
81fa162a7f
commit
84cc1a0042
|
@ -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());
|
||||
};
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue