Convert strings representing base36 numbers into an integer.
359328
def convert_id36_to_numeric_id(id36):
    """"""
    if not isinstance(id36, six.string_types) or id36.count("_") > 0:
        raise ValueError("must supply base36 string, not fullname (e.g. use "
                         "xxxxx, not t3_xxxxx)")
    return int(id36, 36)
1146170
def intToBin(i):
    
    # divide in two parts (bytes)
    i1 = i % 256
    i2 = int(i / 256)
    # make string (little endian)
    return i.to_bytes(2, byteorder='little')
313611
def get_number(s, cast=int):
    
    import string
    d = "".join(x for x in str(s) if x in string.digits)
    return cast(d)
560794
def int2str(num, radix=10, alphabet=BASE85):
    """"""
    return NumConv(radix, alphabet).int2str(num)
239726
def decode_int(self, str):
        
        n = 0
        for c in str:
            n = n * self.BASE + self.ALPHABET_REVERSE[c]
        return n
598719
def nearIntegersPredicate(field):
    """"""
    ints = integers(field)
    near_ints = set()
    for char in ints:
        num = int(char)
        near_ints.add(str(num - 1))
        near_ints.add(str(num))
        near_ints.add(str(num + 1))

    return near_ints
1036910
public static int stringToInteger(String string) {
        string = string.trim();
        if (Checker.isNumber(string)) {
            return Integer.parseInt(string);
        }
        return -1;
    }
148338
def intToBin(i):
    
    # devide in two parts (bytes)
    i1 = i % 256
    i2 = int(i / 256)
    # make string (little endian)
    return chr(i1) + chr(i2)
143142
def base36(value):
    
    result = ''
    while value:
        value, i = divmod(value, 36)
        result = BASE36_ALPHABET[i] + result
    return result
1232855
def base58_from_data(data)
      raise ArgumentError, "Data is missing" if !data
      leading_zeroes = 0
      int = 0
      base = 1
      data.bytes.reverse_each do |byte|
        if byte == 0
          leading_zeroes += 1
        else
          leading_zeroes = 0
          int += base*byte
        end
        base *= 256
      end
      return ("1"*leading_zeroes) + base58_from_int(int)
    end
735002
function(digits, n) {
		n = n.toString();
		while(n.length < digits)
		n = '0' + n;
		return n;
	}
37909
def parse_general_int(s):
    """"""
    mo = re.match(r"(\d+)([KkMGT]?)$", s)
    if mo:
        i, suffix = mo.group(1, 2)
        v = int(i)
        if suffix:
            if suffix == "K" or suffix == "k":
                v *= 1024
            elif suffix == "M":
                v *= (1024 * 1024)
            elif suffix == "G":
                v *= (1024 * 1024 * 1024)
            elif suffix == "T":
                v *= (1024 * 1024 * 1024 * 1024)
            else:
                raise ValueError("invalid integer string %s" % s)
        return v
    else:
        v = int(s)
    return v
1147450
def int_to_base36(i):
    
    if six.PY2:
        char_set = '0123456789abcdefghijklmnopqrstuvwxyz'
        if i < 0:
            raise ValueError("Negative base36 conversion input.")
        if not isinstance(i, six.integer_types):
            raise TypeError("Non-integer base36 conversion input.")
        if i < 36:
            return char_set[i]
        b36 = ''
        while i != 0:
            i, n = divmod(i, 36)
            b36 = char_set[n] + b36
    else:
        from django.utils.http import int_to_base36
        b36 = int_to_base36(i)
    return b36
154817
def string_to_int( s ):
  """"""
  result = 0
  for c in s:
    if not isinstance(c, int): c = ord( c )
    result = 256 * result + c
  return result
313265
def int_to_string( x ):
  """"""
  assert x >= 0
  if x == 0: return b('\0')
  result = []
  while x:
    ordinal = x & 0xFF
    result.append(int2byte(ordinal))
    x >>= 8

  result.reverse()
  return b('').join(result)
385725
def str2int(num, radix=10, alphabet=BASE85):
    """"""
    return NumConv(radix, alphabet).str2int(num)
1136601
def basek_string_to_base10_integer(k, x):
    """"""
    assert 1 < k <= max_k_labeled
    return sum(numeral_index[c]*(k**i)
               for i, c in enumerate(reversed(x)))