lib/tlv.js
function encodeTags(tags) {
  var bufLength = 0;
  var tagLengths = []
  
  for (var i = 0; i < tags.length; i++) {
    var tagLength = getTagLength(tags[i]);
    tagLengths.push(tagLength);
    bufLength += tagLength;
  }
  
  var buf = new Buffer(bufLength);
  var slicedBuf = buf;
  
  for (var i = 0; i < tags.length; i++) {
    encodeNumber(slicedBuf, tags[i], tagLengths[i]);
    slicedBuf = slicedBuf.slice(tagLengths[i]);
  }
  
  return buf;
}
function encodeTags(tags) {
  var bufLength = 0;
  var tagLengths = []
  
  for (var i = 0; i < tags.length; i++) {
    var tagLength = getTagLength(tags[i]);
    tagLengths.push(tagLength);
    bufLength += tagLength;
  }
  
  var buf = new Buffer(bufLength);
  var slicedBuf = buf;
  
  for (var i = 0; i < tags.length; i++) {
    encodeNumber(slicedBuf, tags[i], tagLengths[i]);
    slicedBuf = slicedBuf.slice(tagLengths[i]);
  }
  
  return buf;
}
function encodeTags ( tags ) { var bufLength = 0 ; var tagLengths = [ ] for ( var i = 0 ; i < tags . length ; i ++ ) { var tagLength = getTagLength ( tags [ i ] ) ; tagLengths . push ( tagLength ) ; bufLength += tagLength ; } var buf = new Buffer ( bufLength ) ; var slicedBuf = buf ; for ( var i = 0 ; i < tags . length ; i ++ ) { encodeNumber ( slicedBuf , tags [ i ] , tagLengths [ i ] ) ; slicedBuf = slicedBuf . slice ( tagLengths [ i ] ) ; } return buf ; }
Encodes an array of tags in a new Buffer.

@param {Array} tags
@return {Buffer}
Encodes an array of tags in a new Buffer .