code: function (num, totalBytes) {
    var numBytes = Math.floor(Math.log(num) / Math.log(0xff)) + 1;
    var buffer = new Buffer(totalBytes);
  
    buffer.fill(0);
    buffer.writeUIntBE(num, totalBytes - numBytes, numBytes);
  
    return buffer;
  }
docs: Return a number in a buffer padded to have a certain number of bytes