The bit
library provides bitwise operations.
local bit = require("bit");
Refer to the official documentation from LuaJIT for more details.
Returns the bitwise not of x
.
Returns the bitwise and of x
and y
.
Returns the bitwise or of x
and y
.
Returns the bitwise exclusive or of x
and y
.
Returns the bitwise logical left shift of x
of n
steps.
Returns the bitwise logical right shift of x
of n
steps.
Returns the bitwise arithmetic right shift of x
of n
steps.
Returns the bitwise left rotation of x
of n
steps.
Returns the bitwise right rotation of x
of n
steps.
Helper function to convert a number to a hex string.
Helper function to normalize values