<commit_before>/**
 * Module dependencies
 */
var events        = require('events')
  , crypto        = require('crypto')
  , Store         = require('./store')
  , eos           = require('end-of-stream')
  , mqttPacket    = require('mqtt-packet')
  , Writable      = require('readable-stream').Writable
  , inherits      = require('inherits')
  , setImmediate  = global.setImmediate || function(callback) {
      // works in node v0.8
      process.nextTick(callback);
    };

/**
 * Default options
 */
var defaultConnectOptions = {
  keepalive: 10,
  protocolId: 'MQTT',
  protocolVersion: 4,
  reconnectPeriod: 1000,
  clean: true,
  encoding: 'utf8'
};

var defaultId = function() {
  return 'mqttjs_' + crypto.randomBytes(8).toString('hex');
};

function nop() {}

/**
 * MqttClient constructor
 *
 * @param {Stream} stream - stream
 * @param {Object} [options] - connection options
 * (see Connection#connect)
 */
var MqttClient = module.exports =
function MqttClient(streamBuilder, options) {
  var that = this;

  if (!(this instanceof MqttClient)) {
    return new MqttClient(streamBuilder, options);
  }

  this.options = options || {};
<commit_msg>Don't load "crypto" just for "randomBytes"<commit_after>/**
 * Module dependencies
 */
var events        = require('events')
  , Store         = require('./store')
  , eos           = require('end-of-stream')
  , mqttPacket    = require('mqtt-packet')
  , Writable      = require('readable-stream').Writable
  , inherits      = require('inherits')
  , setImmediate  = global.setImmediate || function(callback) {
      // works in node v0.8
      process.nextTick(callback);
    };

/**
 * Default options
 */
var defaultConnectOptions = {
  keepalive: 10,
  protocolId: 'MQTT',
  protocolVersion: 4,
  reconnectPeriod: 1000,
  clean: true,
  encoding: 'utf8'
};

var defaultId = function() {
  return 'mqttjs_' + Math.random().toString(16).substr(2, 8);
};

function nop() {}

/**
 * MqttClient constructor
 *
 * @param {Stream} stream - stream
 * @param {Object} [options] - connection options
 * (see Connection#connect)
 */
var MqttClient = module.exports =
function MqttClient(streamBuilder, options) {
  var that = this;

  if (!(this instanceof MqttClient)) {
    return new MqttClient(streamBuilder, options);
  }

  this.options = options || {};

{'fraction_non_alphanumeric': 0.14816414686825055, 'fraction_numerical': 0.01079913606911447, 'mean_word_length': 3.265193370165746, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6045625', 'n_tokens_mistral': 752, 'n_tokens_neox': 726, 'n_words': 168}