aboutsummaryrefslogtreecommitdiffhomepage
path: root/public
diff options
context:
space:
mode:
authorMarvin Borner2019-01-26 18:43:33 +0100
committerMarvin Borner2019-01-26 18:43:33 +0100
commit677689257a38cb8b8cf06a5c8d4ad2398381e41d (patch)
tree46c1f0f15bcd9d3465e2188a371246dd56b7b2f0 /public
parent8a9b033466c3cdece656514b5718d0219dc31abe (diff)
Fixed error with nanoid letters
Diffstat (limited to 'public')
-rw-r--r--public/scripts/chat.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/public/scripts/chat.js b/public/scripts/chat.js
index 01377bf..711912b 100644
--- a/public/scripts/chat.js
+++ b/public/scripts/chat.js
@@ -1,10 +1,11 @@
const $ = require('jquery');
const encryption = require('./2_encryption');
-const nanoid = require('nanoid');
+const generate = require('nanoid/generate');
+const nolookalikes = require('nanoid-dictionary/nolookalikes');
let connectedPeers = []; // TODO: Save new peers in array
let connectedPeer;
-const peerId = nanoid();
+const peerId = generate(nolookalikes, 16);
// setup encryption
(async () => {
@@ -36,7 +37,7 @@ function chat() {
* @param id
*/
function connect(id) {
- const connectionId = nanoid();
+ const connectionId = generate(nolookalikes, 16);
console.log('[LOG] Connecting to', id);
console.log('[LOG] Your connection ID is', connectionId);
connectedPeer = peer.connect(id, {label: connectionId, reliable: true});