From 677689257a38cb8b8cf06a5c8d4ad2398381e41d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 26 Jan 2019 18:43:33 +0100 Subject: Fixed error with nanoid letters --- public/scripts/chat.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'public') 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}); -- cgit v1.2.3