mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-21 00:19:42 +02:00
add colon seperators to hex strings in python 3.6 and 3.7
This commit is contained in:
@ -240,7 +240,9 @@ def _b2a(byte_string: bytes) -> str:
|
|||||||
try:
|
try:
|
||||||
return binascii.hexlify(byte_string, ':').decode('utf-8')
|
return binascii.hexlify(byte_string, ':').decode('utf-8')
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return binascii.hexlify(byte_string).decode('utf-8')
|
hex_string = binascii.hexlify(byte_string).decode('utf-8')
|
||||||
|
colon_seperated = ':'.join(hex_string[i:i+2] for i in range(0, len(hex_string), 2))
|
||||||
|
return colon_seperated
|
||||||
|
|
||||||
|
|
||||||
def _fix_objects(obj):
|
def _fix_objects(obj):
|
||||||
|
Reference in New Issue
Block a user