mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-15 11:56:25 +00:00
20 lines
426 B
JavaScript
20 lines
426 B
JavaScript
/**
|
|
* Functions/constants needed by both the client and server.
|
|
*/
|
|
|
|
var extend = require('xtend/mutable')
|
|
|
|
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)
|