|
> Or some way to convert the lua string "1", for example, to the bytesIf x contains the number to be sent, send this string:
> corresponding to C-integer 1?
string.char(
math.floor(x/256^0)%256,
math.floor(x/256^1)%256,
math.floor(x/256^2)%256,
math.floor(x/256^3)%256
)
or this, depending on the order you want the bytes:
string.char(
math.floor(x/256^3)%256
math.floor(x/256^2)%256,
math.floor(x/256^1)%256,
math.floor(x/256^0)%256,
)