Let's say I have A = 0b11110101.
I want to make a new integer like this pseudocode
B[0] = A[4]
B[1] = A[7]
B[2] = A[0]
B[3] = A[6]
B[4] = A[1]
B[5] = A[2]
B[6] = A[3]
B[7] = A[5]
How can I do that?
Maybe I can create an array B first, but at the end I need an integer/binary.
Update #1
I made something like this:
num=0
pc1_tidyHex = []
pc1_tidyHex.append([tidyHex[56], tidyHex[48], tidyHex[40], tidyHex[32], tidyHex[24], tidyHex[16], tidyHex[8]])
num = int(''.join(map(str, pc1_tidyHex)))
print(pc1_tidyHex)
print(num)
and I got this error:
Traceback (most recent call last):
File "F:\TUC Aux\python\budi.py", line 47, in <module>
num = int(''.join(map(str, pc1_tidyHex)))
ValueError: invalid literal for int() with base 10: "['0', '1', '1', '0', '1', '0', '0']"