From bbe2fa35bf5458c2e1caa2b1b10273f4c0445833 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh <feross@feross.org> Date: Sun, 11 May 2014 23:58:42 -0700 Subject: [PATCH] upgrade bn.js --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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",