Recently Luau added the bit32.byteswap function.One would expect bit32.byteswap toThis would be very useful for changing the endianness of data which could easily be done with bitswap + bitwise shift as I expected
Byteswap could easily be implemented with bitwise extract + bitwise shift and bitwise or.Bitswap cannot.So if not for changing endianness why do we even have byteswap but not bitswap? Byteswap just seems like bloat
Recently Luau added thebit32.byteswap
function.One would expectbit32.byteswap
toThis would be very useful for changing the endianness of data which could easily be done with bitswap + bitwise shift as I expectedByteswap could easily be implemented with bitwise extract + bitwise shift and bitwise or.Bitswap cannot.So if not for changing endianness why do we even have byteswap but not bitswap? Byteswap just seems like bloat