don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with input_bin:
So, every time you go through a cycle of the for loop, you’ll just start with the same values in upper_byte, and lower_byte. To sequentially output each shifted value, you’ll instead want something like:
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as <. The same issue exists for the right angle bracket, the ampersand, and I would presume others.