@freesignal/protocol 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node.js +1 -1
- package/dist/test.js +3 -0
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -136,7 +136,7 @@ class FreeSignalNode {
|
|
|
136
136
|
}
|
|
137
137
|
packRelay(receiverId, data) {
|
|
138
138
|
//console.debug("Packing Relay");
|
|
139
|
-
return this.encrypt(receiverId, types_1.Protocols.RELAY,
|
|
139
|
+
return this.encrypt(receiverId, types_1.Protocols.RELAY, data.toBytes());
|
|
140
140
|
}
|
|
141
141
|
packDiscover(receiverId, discoverId) {
|
|
142
142
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/test.js
CHANGED
|
@@ -40,6 +40,9 @@ setImmediate(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
40
40
|
fifth.forEach((data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
41
|
console.log("Bob: ", (0, utils_1.decodeData)((yield alice.open(data)).payload));
|
|
42
42
|
}));
|
|
43
|
+
const msg = yield alice.packData(bob.userId, (0, utils_1.encodeData)("test"));
|
|
44
|
+
const relay = yield alice.packRelay(bob.userId, msg);
|
|
45
|
+
console.log((0, utils_1.compareBytes)(msg.toBytes(), (yield bob.open(relay)).payload));
|
|
43
46
|
//const testone = await Promise.all(Array(400).fill(0).map(() => alice.packData(bob.userId, decodeBase64(crypto.randomBytes(64)))));
|
|
44
47
|
//console.log(((await bob.open(testone[350])).payload));
|
|
45
48
|
}));
|