fn = function(n) {
    var carry = 1;  // initial increment
    for (var i = n.length - 1; i >= 0; --i) {
      // We can't assign n[i] += carry here as it will overflow.
      var y = n[i] + carry;
      n[i] = (y & 0xff);
      carry = (y & 0x100) >>> 8;
    }
    return n;
  }
Inner function to allow static type checking.
@param {(!e2e.ByteArray|!Uint8Array)} n The number to increment.
@return {(!e2e.ByteArray|!Uint8Array)} The incremented array.