from random import randint
l = ("0000", "0011", "0101", "1000", "1010", "1011", "1101", "1111")
u = 0
for y in l:
    u ^= int(y, 2)
print(bin(u))
x = 0b1001010010110101
k = x.bit_length()
p = 0b0110

e = 0
for i in range(k):
    if x & (1 << i):
        print("i :", i, bin(1 << i), f"{e:04b}")
        e ^= i

print("e :", bin(e))

pos = e ^ p
print(pos, bin(pos))
_x = x ^ (1 << (k - 1 - pos))
print(bin(x))
print(bin(_x))

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: