use simple-sha1
This commit is contained in:
parent
463c5278c5
commit
633f2ad531
4
index.js
4
index.js
|
@ -2,7 +2,7 @@ var bencode = require('bencode')
|
||||||
var BitField = require('bitfield')
|
var BitField = require('bitfield')
|
||||||
var EventEmitter = require('events').EventEmitter
|
var EventEmitter = require('events').EventEmitter
|
||||||
var inherits = require('inherits')
|
var inherits = require('inherits')
|
||||||
var sha1 = require('git-sha1')
|
var sha1 = require('simple-sha1')
|
||||||
|
|
||||||
var MAX_METADATA_SIZE = 10000000 // 10MB
|
var MAX_METADATA_SIZE = 10000000 // 10MB
|
||||||
var BITFIELD_GROW = 1000
|
var BITFIELD_GROW = 1000
|
||||||
|
@ -126,7 +126,7 @@ module.exports = function (metadata) {
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|
||||||
// check hash
|
// check hash
|
||||||
if (this._infoHashHex && this._infoHashHex !== sha1(metadata)) {
|
if (this._infoHashHex && this._infoHashHex !== sha1.sync(metadata)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bencode": "^0.6.0",
|
"bencode": "^0.6.0",
|
||||||
"bitfield": "^1.0.1",
|
"bitfield": "^1.0.1",
|
||||||
"git-sha1": "^0.1.2",
|
"inherits": "^2.0.1",
|
||||||
"inherits": "^2.0.1"
|
"simple-sha1": "^2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bittorrent-protocol": "^1.0.0",
|
"bittorrent-protocol": "^1.0.0",
|
||||||
|
|
Loading…
Reference in New Issue