Hexadecimal bytes to integers

pekka niiranen krissepu at vip.fi
Thu Mar 14 06:34:12 EST 2002


How can I convert messages below to list of bytes:

message = 0x01040000000271
or
message = 0104000000A271
to
m = [0,1,0,4,0,0,0,0,0,0,0,0,'A',2,7,1]

so that I can calculate:

a = 255
for byte in m:
        t = a ^ byte



-pekka-




More information about the Python-list mailing list