I want to convert:
'01' -> \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
'0001' -> \x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
I tried something like this:
int(data,16).to_bytes(16, byteorder='little')
but this is not working when string starting with '00'. Is there some other way ?