12 return (val & 0xff), ((val >> 8) & 0xff)
16 return (val0 & 0xff) | ((val1 & 0xff) << 8)
20 if (val1 & 0xff)
is not 0:
21 return ((val0 & 0xff) | ((val1 & 0xff) << 8)) - 0x10000
23 return (val0 & 0xff) | ((val1 & 0xff) << 8)
27 if isinstance(buf, str):
28 return ''.join([
"%02x " % ord(x)
for x
in buf]).strip()
30 return ''.join([
"%02x " % ord(chr(x))
for x
in buf]).strip()
33 return hex(struct.unpack(
'<I', struct.pack(
'<f', f))[0])
36 exc_type, exc_value, exc_traceback = sys.exc_info()
37 traceback.print_exception(exc_type, exc_value, exc_traceback)
def byte_to_hexstring(buf)