diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-09-24 04:11:40 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-09-24 04:11:40 +0300 |
commit | 07ebb2f141b33322506e90b6676f42a6c909929c (patch) | |
tree | c2568bf331a7f76f5602cdca4493df4b7735f7d7 /index.js | |
parent | 2fc07a53a4e1a6c8f65a81f3cdc5d08071274691 (diff) |
Add more peer ID entropy
This still keeps the peer ID printable as ascii, while adding lots more
entropy
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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') |