From a60254e665d3e92616db80eaa69a218030981d1f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 16 Dec 2014 20:18:35 -0800 Subject: treat peer_id as hex everywhere Fixes #203 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.js') 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') -- cgit v1.2.3