Input:
0000001101110010000000100000011110000000100000111000000111110010
Output should be:
302720700838182f
In perl I can do it like this:
unpack("h*", pack("B*", "0000001101110010000000100000011110000000100000111000000111110010"));
"".join([ ("%02x" % int(x,2))[::-1] for x in re.findall(r'.{8}', bits) ])
I'm sure there's a nicer way, but it works: extract 8 bits at a time from the input, use int(..., 2) to parse them as binary, then format as hex, then swap the nibbles ([::-1]), then stick it all back together.
alternatively, if you find the use of re here ugly:
"".join([ ("%02x" % int(bits[i:i+8],2) )[::-1] for i in range(0, len(bits), 8) ])
11110010to82? Guessing at what you mean by "little nibble",2fwould make sense;