code: function (num) {
    var arr = [];
  
    if (num === 0) return new Buffer([0]);
  
    // Break up num into groups of 7-bit values
    while (num) {
      arr.unshift(num & (127));
      num >>= 7;
    }
  
    // Flip MSB of all 7-bit values except the last one
    arr = _.map(_.initial(arr), function (val, i) {
      return val + 128;
    }).concat(_.last(arr));
  
    return new Buffer(arr);
  }
docs: Given a number, return a variable length quantity (in a buffer)