diff --git a/hbmqtt/utils.py b/hbmqtt/utils.py new file mode 100644 index 0000000..ec99bea --- /dev/null +++ b/hbmqtt/utils.py @@ -0,0 +1,10 @@ +# Copyright (c) 2015 Nicolas JOUANIN +# +# See the file license.txt for copying permission. + + +def bytes_to_hex_str(data): + return '0x' + ''.join(format(b, '02x') for b in data) + +def hex_to_int(data): + return int.from_bytes(data, byteorder='big') \ No newline at end of file