title: Error: Invalid hex string
body: <p>Here is my node js code</p>
  
  <pre><code>if (protocol == '01') {
    console.log('...goint to get Ack Obj...');
    var o = getAckObj(hexString);
    console.log('...ack obj received...');
    var msg = ackMsg(o);
    console.log('..going to write buffer...');
    socket.write(new Buffer(msg, 'hex')); //, 'binary');
    console.log('Server sent welcome: ' + msg);
  }
  
  .....
  
  function ackMsg(dataObj) {
    var ackText = '';
    dataObj.len = '05'; //for ack msg its always 05
    var e = crc16(dataObj.len + dataObj.protocol + dataObj.serial, 'hex');
    dataObj.error = e.toString(16);
    return dataObj.start + dataObj.len + dataObj.protocol + dataObj.serial + dataObj.error + dataObj.stop;
  }
  </code></pre>
  
  <p>Here is the value in hexString <code>78780d010387113120864842000ccbe40d0a</code></p>
  
  <p>On console out put</p>
  
  <pre><code>...goint to get Ack Obj...
  ...ack obj received...
  ..going to write buffer...
  buffer.js:348
        ret = this.parent.hexWrite(string, this.offset + offset, length);
  </code></pre>