mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 10:31:36 +00:00
upgrade bn.js
This commit is contained in:
parent
d0c1caf83b
commit
bbe2fa35bf
4
index.js
4
index.js
@ -3,7 +3,7 @@
|
|||||||
exports.Client = Client
|
exports.Client = Client
|
||||||
exports.Server = Server
|
exports.Server = Server
|
||||||
|
|
||||||
var bn = require('bn.js')
|
var BN = require('bn.js')
|
||||||
var bncode = require('bncode')
|
var bncode = require('bncode')
|
||||||
var compact2string = require('compact2string')
|
var compact2string = require('compact2string')
|
||||||
var dgram = require('dgram')
|
var dgram = require('dgram')
|
||||||
@ -702,7 +702,7 @@ function toUInt32 (n) {
|
|||||||
|
|
||||||
function toUInt64 (n) {
|
function toUInt64 (n) {
|
||||||
if (n > MAX_UINT || typeof n === 'string') {
|
if (n > MAX_UINT || typeof n === 'string') {
|
||||||
var bytes = bn(n).toArray()
|
var bytes = new BN(n).toArray()
|
||||||
while (bytes.length < 8) {
|
while (bytes.length < 8) {
|
||||||
bytes.unshift(0)
|
bytes.unshift(0)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
"querystring": "^0.2.0",
|
"querystring": "^0.2.0",
|
||||||
"run-parallel": "^1.0.0",
|
"run-parallel": "^1.0.0",
|
||||||
"string2compact": "^1.1.0",
|
"string2compact": "^1.1.0",
|
||||||
"bn.js": "^0.3.1"
|
"bn.js": "^0.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"parse-torrent": "^1.1.0",
|
"parse-torrent": "^1.1.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user