added bootstrap and utils

This commit is contained in:
ingvar1995 2016-02-20 11:06:24 +03:00
parent adec996e40
commit 6b575da515
3 changed files with 108 additions and 0 deletions

View file

@ -5,3 +5,12 @@ def log(data):
with open("logs.log", "a") as fl:
fl.write(str(data))
def string_to_bin(tox_id):
return tox_id.decode("hex")
def bin_to_string(raw_id):
res = ''.join('{:02x}'.format(ord(x)) for x in raw_id)
return res.upper()