Allow specifying whether to compress key in ECKey.toBytes
This commit is contained in:
parent
6cc7a23bdd
commit
ecbb6f81ee
1 changed files with 2 additions and 1 deletions
|
@ -135,7 +135,8 @@ ECPubKey.prototype['export'] = function(format) {
|
|||
return this['to' + format.substr(0, 1).toUpperCase() + format.substr(1)]()
|
||||
}
|
||||
|
||||
ECPubKey.prototype.toBytes = function() {
|
||||
ECPubKey.prototype.toBytes = function(compressed) {
|
||||
if (compressed === undefined) compressed = this.compressed
|
||||
return this.pub.getEncoded(this.compressed)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue