Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more peer ID entropy #932

Merged
merged 1 commit into from Sep 29, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Add more peer ID entropy

This still keeps the peer ID printable as ascii, while adding lots more
entropy
  • Loading branch information
feross committed Sep 24, 2016
commit 07ebb2f141b33322506e90b6676f42a6c909929c
@@ -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')

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.