I would like to find a way to reverse the bits of each character in a string using python.
For example, if my first character was J
, this is ASCII 0x4a
or 0b01001010
, so would be reversed to 0x52
or 0b01010010
. If my second character was K
, this is 0b01001011
, so would be reversed to 0xd2
or 0b11010010
, etc.
The end result should be returned as a string
.
Speed is my number one priority here, so I am looking for a fast way to accomplish this.