I have a long Hex string that represents a series of values of different types. I wish to convert this Hex String into a byte array so that I can shift each value out and co
def hex2bin(s): hex_table = ['0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111', '1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111'] bits = '' for i in range(len(s)): bits += hex_table[int(s[i], base=16)] return bits