Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bittorrent-tracker

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bittorrent-tracker - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

19

index.js
exports.Client = Client
exports.Server = Server
var bignum = require('bignum')
// optional compiled dependency. if it doesn't compile, no big deal.
var bignum
try {
bignum = require('bignum')
} catch (e) {}
var bncode = require('bncode')

@@ -21,2 +26,3 @@ var compact2string = require('compact2string')

var EVENTS = { completed: 1, started: 2, stopped: 3 }
var MAX_UINT = 4294967295

@@ -526,3 +532,12 @@ inherits(Client, EventEmitter)

function toUInt64 (n) {
return bignum(n).toBuffer({ size: 8 })
if (typeof bignum === 'function') {
return bignum(n).toBuffer({ size: 8 })
} else {
// optional compiled dependency 'bignum' is not available, so round down to MAX_UINT.
// These values are only used for tracker stats anyway.
if (n > MAX_UINT) {
n = MAX_UINT
}
return Buffer.concat([toUInt32(0), toUInt32(n)])
}
}

@@ -529,0 +544,0 @@

8

package.json
{
"name": "bittorrent-tracker",
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
"version": "0.4.0",
"version": "0.4.1",
"author": {

@@ -14,3 +14,2 @@ "name": "Feross Aboukhadijeh",

"dependencies": {
"bignum": "^0.6.2",
"bncode": "^0.5.2",

@@ -26,6 +25,9 @@ "compact2string": "^1.2.0",

"devDependencies": {
"parse-torrent": "^0.6.0",
"parse-torrent": "^0.9.0",
"portfinder": "^0.2.1",
"tape": "2.x"
},
"optionalDependencies": {
"bignum": "^0.6.2"
},
"homepage": "http://webtorrent.io",

@@ -32,0 +34,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc