@hive-p2p/browser 1.0.90 → 1.0.92
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/core/crypto-codex.mjs +4 -2
- package/core/node.mjs +1 -2
- package/hive-p2p.min.js +2 -2
- package/package.json +1 -1
- package/rendering/NetworkRenderer.mjs +7 -5
- package/services/cryptos.mjs +7 -1
package/core/crypto-codex.mjs
CHANGED
|
@@ -78,8 +78,10 @@ export class CryptoCodex {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// PRIVACY
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
/** @param {string} [seedHex] A 32bytes hex-encoded seed for key generation */
|
|
82
|
+
generateEphemeralX25519Keypair(seedHex) {
|
|
83
|
+
const seed = seedHex ? this.converter.hexToBytes(seedHex) : undefined;
|
|
84
|
+
const { secretKey, publicKey } = x25519.keygen(seed);
|
|
83
85
|
return { myPub: publicKey, myPriv: secretKey };
|
|
84
86
|
}
|
|
85
87
|
computeX25519SharedSecret(secret, pub) {
|
package/core/node.mjs
CHANGED
|
@@ -284,8 +284,7 @@ export class Node {
|
|
|
284
284
|
onGossipData(callback) { this.gossip.on('gossip', callback); }
|
|
285
285
|
/** Triggered when a new signal offer is received from another peer. @param {function(string, SignalData)} callback can use arguments: (senderId:string, data:SignalData) */
|
|
286
286
|
onSignalOffer(callback) { this.messager.on('signal_offer', callback); this.gossip.on('signal_offer', callback); }
|
|
287
|
-
/** Triggered when a new signal answer is received from another peer.
|
|
288
|
-
* @param {function(string, SignalData)} callback can use arguments: (senderId:string, data:SignalData) */
|
|
287
|
+
/** Triggered when a new signal answer is received from another peer. @param {function(string, SignalData)} callback can use arguments: (senderId:string, data:SignalData) */
|
|
289
288
|
onSignalAnswer(callback) { this.messager.on('signal_answer', callback); }
|
|
290
289
|
|
|
291
290
|
/** Kick a peer. @param {string} peerId @param {string} [reason] */
|