I am trying to XOR two large binary values. However,
echo ${hashArray[1]}
echo ${hashArray[2]}
echo $((${hashArray[1]} ^ ${hashArray[2]}))
gives:
10100100000111101011100001101110000110000100001000000111001001100010110000010010111101100110111001111100010010000000010101110111
00001110110000010110101101011011100101101000011100011101001101101010000100110001001110101101111100010001111010100011010000000100
4018181242766406943
Why does echo $((${hashArray[1]} ^ ${hashArray[2]})) output a decimal number? Shouldn’t it be another large binary value?
Do it “bitwise” like that:
output:
edit: The inputs need to have the same length!