11.01.2023, 12:57
Hello,
i need extraxt every single of 32 bit from 4-byte
i try this scrip but something is wrong, because ist always FALSE on eaxh bit
value = event.getvalue()
function getbit(value, nr)
value = bit.rshift(value, nr)
return bit.band(value, 1)==1
end
bit0 = getbit(value,0)
log(bit0)
bit1 = getbit(value,1)
log(bit1)
.
.
.
.
bit32 = getbit(value,32)
log(bit32)
i need extraxt every single of 32 bit from 4-byte
i try this scrip but something is wrong, because ist always FALSE on eaxh bit
value = event.getvalue()
function getbit(value, nr)
value = bit.rshift(value, nr)
return bit.band(value, 1)==1
end
bit0 = getbit(value,0)
log(bit0)
bit1 = getbit(value,1)
log(bit1)
.
.
.
.
bit32 = getbit(value,32)
log(bit32)