mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +00:00
Ensure infoHash is lowercase
This commit is contained in:
parent
e782ff382b
commit
3ec7aace26
@ -51,7 +51,7 @@ function Client (opts) {
|
|||||||
self._peerIdBinary = self._peerIdBuffer.toString('binary')
|
self._peerIdBinary = self._peerIdBuffer.toString('binary')
|
||||||
|
|
||||||
self.infoHash = typeof opts.infoHash === 'string'
|
self.infoHash = typeof opts.infoHash === 'string'
|
||||||
? opts.infoHash
|
? opts.infoHash.toLowerCase()
|
||||||
: opts.infoHash.toString('hex')
|
: opts.infoHash.toString('hex')
|
||||||
self._infoHashBuffer = Buffer.from(self.infoHash, 'hex')
|
self._infoHashBuffer = Buffer.from(self.infoHash, 'hex')
|
||||||
self._infoHashBinary = self._infoHashBuffer.toString('binary')
|
self._infoHashBinary = self._infoHashBuffer.toString('binary')
|
||||||
|
Loading…
Reference in New Issue
Block a user