Add toBase58, toWif to ECPubKey

This commit is contained in:
Andreas Brekken 2014-01-16 14:02:21 +07:00
parent ecbb6f81ee
commit 8ccb8ad70a

View file

@ -148,6 +148,12 @@ ECPubKey.prototype.toBin = function() {
return conv.bytesToString(this.toBytes())
}
ECPubKey.prototype.toBase58 = function() {
return base58.checkEncode(this.toBytes(), 128)
}
ECPubKey.prototype.toWif = ECPubKey.prototype.toBase58
ECPubKey.prototype.toString = function() {
return this.getBitcoinAddress().toString()
}