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>2014-12-22 12:33:00 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-12-22 12:33:00 +0300
commit26aa682e92ce9894789604623206c436f950570c (patch)
treedc087a9c9bd929462451899150b805330bc3d9c7 /index.js
parent7bfff0149063a0c137f78b81c6c309a35eb9a707 (diff)
parenta60254e665d3e92616db80eaa69a218030981d1f (diff)
Merge pull request #216 from feross/hex-everything
treat peer_id as hex everywhere
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 6e4c9b5..d63bea6 100644
--- a/index.js
+++ b/index.js
@@ -61,7 +61,7 @@ function WebTorrent (opts) {
self.peerId = opts.peerId === undefined
? new Buffer('-WW' + VERSION + '-' + hat(48), 'utf8')
: typeof opts.peerId === 'string'
- ? new Buffer(opts.peerId, 'utf8')
+ ? new Buffer(opts.peerId, 'hex')
: opts.peerId
self.peerIdHex = self.peerId.toString('hex')