Skip to content

Commit fcf28cb

Browse files
authored
Replace new Buffer with Buffer.from
Code is already using safe-buffer, just replace the constructor API
1 parent 2cd8f3f commit fcf28cb

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)