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-17 07:18:35 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-12-17 07:19:59 +0300
commita60254e665d3e92616db80eaa69a218030981d1f (patch)
treed87c03fcbe5cc97cd366c1d92d5340955be48762 /index.js
parentd0436e41e72780d001048079bf265c08ecb1fd53 (diff)
treat peer_id as hex everywhere
Fixes #203
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 8cf9073..76279ae 100644
--- a/index.js
+++ b/index.js
@@ -51,7 +51,7 @@ function WebTorrent (opts) {
self.peerId = opts.peerId === undefined
? new Buffer('-WW0001-' + 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')