20 lines
490 B
Python
20 lines
490 B
Python
def now():
|
|
return int(time())
|
|
|
|
def get_json(text):
|
|
return json.loads(re.sub(r"for.*(.*;.*;.*).*;", '', text.decode("unicode-escape").encode("utf-8")))
|
|
|
|
def digit_to_char(digit):
|
|
if digit < 10:
|
|
return str(digit)
|
|
return chr(ord('a') + digit - 10)
|
|
|
|
def str_base(number,base):
|
|
if number < 0:
|
|
return '-' + str_base(-number, base)
|
|
(d, m) = divmod(number, base)
|
|
if d > 0:
|
|
return str_base(d, base) + digit_to_char(m)
|
|
return digit_to_char(m)
|
|
|