index.js
function gen(spark, fn) {
    crypto.randomBytes(8, function generated(err, buff) {
      if (err) return fn(err);

      fn(undefined, buff.toString('hex'));
    });
  }
function gen(spark, fn) {
    crypto.randomBytes(8, function generated(err, buff) {
      if (err) return fn(err);

      fn(undefined, buff.toString('hex'));
    });
  }
function gen ( spark , fn ) { crypto . randomBytes ( 8 , function generated ( err , buff ) { if ( err ) return fn ( err ) ; fn ( undefined , buff . toString ( 'hex' ) ) ; } ) ; }
Generator of session ids. It should call the callback with a string that
should be used as session id. If a generation failed you should set an
error as first argument in the callback.

This function will only be called if there is no id sent with the request.

@param {Spark} spark The incoming connection.
@param {Function} fn Completion callback.
@api public
Generator of session ids . It should call the callback with a string that should be used as session id . If a generation failed you should set an error as first argument in the callback .