Skip to content

Commit 6ce0d51

Browse files
Merge pull request webtorrent#267 from jasnell/patch-1
Replace new Buffer with Buffer.from
2 parents 2cd8f3f + fcf28cb commit 6ce0d51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function Server (opts) {
174174
}
175175
var client = clients[peer.client.client]
176176
// If the client is not known show 8 chars from peerId as version
177-
var version = peer.client.version || new Buffer(peer.peerId, 'hex').toString().substring(0, 8)
177+
var version = peer.client.version || Buffer.from(peer.peerId, 'hex').toString().substring(0, 8)
178178
if (!client[version]) {
179179
client[version] = 0
180180
}

0 commit comments

Comments
 (0)