Lua:wordToByteTable
Jump to navigation
Jump to search
function wordToByteTable(Number) : Table
Converts a 16-bit word (integer) to a table of bytes.
Function Parameters
Parameter | Type | Description |
---|---|---|
Number | Integer | The 16-bit word to convert. |
Returns
Table — A table containing the bytes representing the word.
Examples
local bytes = wordToByteTable(0x1234) for i, b in ipairs(bytes) do print(string.format("Byte %d: %02X", i, b)) end -- Output: Byte 1: 34, Byte 2: 12 (little-endian order)
See also
Related Functions
- readBytes
- readSmallInteger
- readInteger
- readQword
- readPointer
- readFloat
- readDouble
- readString
- writeBytes
- writeSmallInteger
- writeInteger
- writeQword
- writeFloat
- writeDouble
- writeString
- readBytesLocal
- readIntegerLocal
- readQwordLocal
- readPointerLocal
- readFloatLocal
- readDoubleLocal
- readStringLocal
- writeBytesLocal
- writeIntegerLocal
- writeQwordLocal
- writeFloatLocal
- writeDoubleLocal
- writeStringLocal
- wordToByteTable
- dwordToByteTable
- qwordToByteTable
- floatToByteTable
- doubleToByteTable
- stringToByteTable
- wideStringToByteTable
- byteTableToWord
- byteTableToDword
- byteTableToQword
- byteTableToFloat
- byteTableToDouble
- byteTableToString
- byteTableToWideString