diff --git a/package.json b/package.json index f9448c9a..9c5e323f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "drag-drop": "^2.12.1", "electron": "1.3.3", "fs-extra": "^0.30.0", - "hat": "0.0.3", "iso-639-1": "^1.2.1", "languagedetect": "^1.1.1", "location-history": "^1.0.0", diff --git a/src/renderer/webtorrent.js b/src/renderer/webtorrent.js index e21c1c1c..0c00be4f 100644 --- a/src/renderer/webtorrent.js +++ b/src/renderer/webtorrent.js @@ -2,11 +2,11 @@ // process from the main window. console.time('init') +var crypto = require('crypto') var deepEqual = require('deep-equal') var defaultAnnounceList = require('create-torrent').announceList var electron = require('electron') var fs = require('fs-extra') -var hat = require('hat') var musicmetadata = require('musicmetadata') var networkAddress = require('network-address') var path = require('path') @@ -56,7 +56,7 @@ var VERSION_PREFIX = '-WD' + VERSION_STR + '-' // Connect to the WebTorrent and BitTorrent networks. WebTorrent Desktop is a hybrid // client, as explained here: https://webtorrent.io/faq var client = window.client = new WebTorrent({ - peerId: Buffer.from(VERSION_PREFIX + hat(48)) + peerId: Buffer.from(VERSION_PREFIX + crypto.randomBytes(6).toString('hex')) }) // WebTorrent-to-HTTP streaming sever