I have several hexadecimal values ββthat I am trying to write to a file. Lua does not seem to support this out of the box, as they are all treated as strings instead of values. I decided that I would have to split the longer hexadecimal value, such as AABBCC, into AA, BB, CC and use string.char () sequentially for all of my decimal values ββto complete the job.
Is there a built-in function that allows me to write such values ββdirectly without converting them first? I used escape characters like "0xAA" and "\ xAA", but that didn't work.
Edit: Let me give you an example. I look at the test file in a hex editor:
00000000 00 00 00 00 00 00 ......
And I want to write him as follows with the string "AABBCC":
00000000 AA BB CC 00 00 00 ......
What I get with escape characters:
00000000 41 41 42 42 43 43 AABBCC
source share