bit. bswap Synchronous
Reverse the order of a number’s four bytes. Use it when a 32-bit value arrives in the opposite byte order from the one your binary format expects.
Luau
bit.bswap(value: number) -> numberParameters
| Parameter | Type | Description |
|---|---|---|
value | number | Finite number interpreted as an unsigned 32-bit value. |
Returns
numberAn unsigned 32-bit result represented as a Luau number.
Differences from Volt
Volt documents its Bit Library setting as disabled by default. Kawaii enables bit by default. Disabling the setting removes the bit global and makes retained function references reject calls.
Availability
Bit is enabled by default. The bit global is removed when disabled, and its operations check the setting.
Example
Luau
print(bit.tohex(bit.bswap(0x12345678))) -- 78563412