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:
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')