Comparing version 0.8.3 to 0.8.4
{ | ||
"name": "curvecp", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"description": "Pure javascript CurveCP library", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -66,2 +66,20 @@ 'use strict' | ||
PacketStream.prototype.toMetadata = function () { | ||
return { | ||
isServer: this.isServer, | ||
serverPublicKey: this._encode(this.serverPublicKey), | ||
clientPublicKey: this._encode(this.clientPublicKey), | ||
serverConnectionPublicKey: this._encode(this.serverConnectionPublicKey), | ||
clientConnectionPublicKey: this._encode(this.clientConnectionPublicKey) | ||
} | ||
} | ||
PacketStream.prototype._encode = function (array) { | ||
if (array !== undefined && array !== null) { | ||
return nacl.util.encodeBase64(array) | ||
} else { | ||
return | ||
} | ||
} | ||
PacketStream.prototype._canSend = function () { | ||
@@ -68,0 +86,0 @@ return this.__canSend |
64562
1570