Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-09-30 01:05:43 +0300
committerGitHub <noreply@github.com>2016-09-30 01:05:43 +0300
commit3f46e2edd5e9bb346666ba0b489282d377db22f7 (patch)
treeacdb4e21e4d38be93c04250e4697a361c9d3d506 /index.js
parent9fe008f7308e5c8fc2f4d3ce52f4fb54eb285744 (diff)
parent07ebb2f141b33322506e90b6676f42a6c909929c (diff)
Merge pull request #932 from feross/peerid
Add more peer ID entropy
Diffstat (limited to 'index.js')
-rw-r--r--index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.js b/index.js
index 8345429..667e16c 100644
--- a/index.js
+++ b/index.js
@@ -65,7 +65,7 @@ function WebTorrent (opts) {
} else if (Buffer.isBuffer(opts.peerId)) {
self.peerId = opts.peerId.toString('hex')
} else {
- self.peerId = Buffer.from(VERSION_PREFIX + randombytes(6).toString('hex')).toString('hex')
+ self.peerId = Buffer.from(VERSION_PREFIX + randombytes(9).toString('base64')).toString('hex')
}
self.peerIdBuffer = Buffer.from(self.peerId, 'hex')