toxygen/src/util.py

15 lines
255 B
Python
Raw Normal View History

2016-02-19 22:10:24 +01:00
def log(data):
with open("logs.log", "a") as fl:
fl.write(str(data))
2016-02-20 09:06:24 +01:00
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()