Converts an integer into a base36 string.
519459
def base36encode(number):
    """"""

    ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz"

    base36 = ''
    sign = ''

    if number < 0:
        sign = '-'
        number = -number

    if 0 <= number < len(ALPHABET):
        return sign + ALPHABET[number]

    while number != 0:
        number, i = divmod(number, len(ALPHABET))
        base36 = ALPHABET[i] + base36

    return sign + base36
1131992
private static String unsignedToString(int value) {
        if (value >= 0) {
            return Integer.toString(value);
        } else {
            return Long.toString((value) & 0x00000000FFFFFFFFL);
        }
    }
228940
def InsertInt16Arg(self, string="", **_):
    """"""
    try:
      int_value = int(string, 16)
      return self.InsertArg(int_value)
    except (TypeError, ValueError):
      raise ParseError("%s is not a valid base16 integer." % string)
761005
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value === 'string') {
    return value
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : ''
  }
  var result = value + ''
  return result == '0' && 1 / value == -INFINITY ? '-0' : result
}
465167
public static final Function<BigInteger,String> toStr() {
        return (Function<BigInteger,String>)((Function)FnNumber.toStr());
    }
360997
def _unpack_int_base128(varint, offset):
        """"""
        res = ord(varint[offset])
        if ord(varint[offset]) >= 0x80:
            offset += 1
            res = ((res - 0x80) << 7) + ord(varint[offset])
            if ord(varint[offset]) >= 0x80:
                offset += 1
                res = ((res - 0x80) << 7) + ord(varint[offset])
                if ord(varint[offset]) >= 0x80:
                    offset += 1
                    res = ((res - 0x80) << 7) + ord(varint[offset])
                    if ord(varint[offset]) >= 0x80:
                        offset += 1
                        res = ((res - 0x80) << 7) + ord(varint[offset])
        return res, offset + 1
1172960
private static int toInt(String str, int defaultVal) {
    try {
      return Integer.parseInt(str.trim());
    } catch (Exception e) {
      return defaultVal;
    }
  }
884099
def int2base36(n):
    
    assert isinstance(n, (int, long))
    c = '0123456789abcdefghijklmnopqrstuvwxyz'
    if n < 0:
        return '-' + int2base36(-n)
    elif n < 36:
        return c[n]
    b36 = ''
    while n != 0:
        n, i = divmod(n, 36)
        b36 = c[i] + b36
    return b36
1052295
def as_number(as_number_val):
    """"""
    as_number_str = py23_compat.text_type(as_number_val)
    if "." in as_number_str:
        big, little = as_number_str.split(".")
        return (int(big) << 16) + int(little)
    else:
        return int(as_number_str)
227848
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if (isArray_1(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return _arrayMap(value, baseToString) + '';
  }
  if (isSymbol_1(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
819645
def int_to_string(number, alphabet, padding=None):
    
    output = ""
    alpha_len = len(alphabet)
    while number:
        number, digit = divmod(number, alpha_len)
        output += alphabet[digit]
    if padding:
        remainder = max(padding - len(output), 0)
        output = output + alphabet[0] * remainder
    return output[::-1]
1370243
def get_readable_string(integer):
    
    """
    if integer == 9:    #\t
        readable_string = "\\t"
    elif integer == 10: #\r
        readable_string = "\\r"
    elif integer == 13:  #\n
        readable_string = "\\n"
    elif integer == 32:  # space
        readable_string = '__'
    elif integer >= 33 and integer <= 126:  # Readable ascii
        readable_string = ''.join([chr(integer), '.'])
    else:  # rest
        readable_string = int_to_padded_hex_byte(integer)

    return readable_string
334209
def b2a_base58(s):
    """"""
    v, prefix = to_long(256, lambda x: x, iterbytes(s))
    s = from_long(v, prefix, BASE58_BASE, lambda v: BASE58_ALPHABET[v])
    return s.decode("utf8")
1126049
def b58enc(uid):
    ''''''
    # note: i tested a buffer array too, but string concat was 2x faster
    if not isinstance(uid, int):
        raise ValueError('Invalid integer: {}'.format(uid))
    if uid == 0:
        return BASE58CHARS[0]
    enc_uid = ""
    while uid:
        uid, r = divmod(uid, 58)
        enc_uid = BASE58CHARS[r] + enc_uid
    return enc_uid
59828
function bignumToString(bignum, base, alphabet) {
        // Prefer native conversion
        if (alphabet === "native" && base != 6) {
            return bignum.toString(base);
        }

        // Old-sk00l conversion
        var result = [];

        while (bignum.gt(0)) {
            var ord = bignum.mod(base);
            result.push(alphabet.charAt(ord));
            bignum = bignum.div(base);
        }

        return result.reverse().join("");
    }
540547
def paddedInt(i):
    '''
    
    '''
    i_str = str(i)
    pad = PAD_LEN - len(i_str)
    return (pad * "0") + i_str
329874
def encode_int(self, n):
        
        str = []
        while True:
            n, r = divmod(n, self.BASE)
            str.append(self.ALPHABET[r])
            if n == 0: break
        return ''.join(reversed(str))