kopia lustrzana https://github.com/Yakifo/amqtt
Add some byte conversion utilities
rodzic
35577ab99a
commit
2b45fc6a3e
|
@ -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')
|
Ładowanie…
Reference in New Issue