var util = { debug: false, inherits: function(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }, extend: function(dest, source) { source = source || {}; for(var key in source) { if(source.hasOwnProperty(key)) { dest[key] = source[key]; } } return dest; }, randomId: function () { return (Math.random().toString(36) + '0000000000000000000').substr(2, 16); }, prettyError: function (msg) { console.log('ERROR PeerServer: ', msg); } }; module.exports = util;