bittorrent-tracker/lib/common.js

23 lines
557 B
JavaScript
Raw Normal View History

/**
* Functions/constants needed by both the client and server.
*/
var extend = require('xtend/mutable')
2014-12-12 23:09:40 +00:00
exports.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
2015-07-29 07:26:44 +00:00
exports.DEFAULT_ANNOUNCE_INTERVAL_WEBRTC = 60 * 1000 // 1 minute
exports.DEFAULT_ANNOUNCE_PEERS = 50
exports.MAX_ANNOUNCE_PEERS = 82
exports.binaryToHex = function (str) {
return new Buffer(str, 'binary').toString('hex')
}
exports.hexToBinary = function (str) {
return new Buffer(str, 'hex').toString('binary')
}
var config = require('./common-node')
extend(exports, config)