function readInt(radix, len) {
    var start = tokPos;
    var total = 0;
    var e = (len === undefined) ? Infinity : len;
    for (var i = 0; i < e; ++i) {
      var code = input.charCodeAt(tokPos), val;
      if (code >= 97) {
        val = code - 97 + 10; // a
      } else if (code >= 65) {
        val = code - 65 + 10; // A
      } else if (code >= 48 && code <= 57) {
        val = code - 48; // 0-9
      } else {
        val = Infinity;
      }
      if (val >= radix) break;
      ++tokPos;
      total = total * radix + val;
    }
    if (tokPos === start || len !== undefined && tokPos - start !== len) {
      return null;
    }
    return total;
  }
Read an integer in the given radix. Return null if zero digits
were read, the integer value otherwise. When `len` is given, this
will return `null` unless the integer has exactly `len` digits.
@param {number} radix
@param {number=} len
@returns {?number}