Atomic docs

bit.bswap

bit.bswap(x: number): number

Reverses the byte order of a 32 bit value, turning little endian into big endian and back.

Example

lua
print(bit.tohex(bit.bswap(0x12345678))) --> 78563412
↑