/**
 * Functions/constants needed by both the client and server.
 */

var extend = require('xtend/mutable')

exports.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes

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)

@@ -200,16 +200,38 @@
 _PEERS =
+ process.browser ? 5 :
  50%0Aexpo

generate 5 offers in the browser, not 50