Remove 'hat' dependency

This commit is contained in:
Feross Aboukhadijeh
2016-08-24 00:40:33 -07:00
parent 83901eecba
commit 396d769bc8
2 changed files with 2 additions and 3 deletions

View File

@@ -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",

View File

@@ -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