diff --git a/index.js b/index.js index 87eca89..d5494ff 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ exports.Client = Client exports.Server = Server -var bn = require('bn.js') +var BN = require('bn.js') var bncode = require('bncode') var compact2string = require('compact2string') var dgram = require('dgram') @@ -702,7 +702,7 @@ function toUInt32 (n) { function toUInt64 (n) { if (n > MAX_UINT || typeof n === 'string') { - var bytes = bn(n).toArray() + var bytes = new BN(n).toArray() while (bytes.length < 8) { bytes.unshift(0) } diff --git a/package.json b/package.json index 549fcfe..d18ef2d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "querystring": "^0.2.0", "run-parallel": "^1.0.0", "string2compact": "^1.1.0", - "bn.js": "^0.3.1" + "bn.js": "^0.4.3" }, "devDependencies": { "parse-torrent": "^1.1.0",