core/utils.js
function stringToBuffer(str) {
    var buf = new Buffer(str.length);
    for (var i = 0; i < buf.length; i++) {
      buf.writeUInt8(str.charCodeAt(i), i);
    }
    return buf;
  }
function stringToBuffer(str) {
    var buf = new Buffer(str.length);
    for (var i = 0; i < buf.length; i++) {
      buf.writeUInt8(str.charCodeAt(i), i);
    }
    return buf;
  }
function stringToBuffer ( str ) { var buf = new Buffer ( str . length ) ; for ( var i = 0 ; i < buf . length ; i ++ ) { buf . writeUInt8 ( str . charCodeAt ( i ) , i ) ; } return buf ; }
Converts a string to a Buffer
Converts a string to a Buffer