This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Hex manipulation
#5
By default hextostr discards zero bytes, you have to pass a second argument for it to keep zeros. Next two lines result in the same binary string:
Code:
c1 = string.char(0xBF,0xF4,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0x04,0xA2)
c2 = lmcore.hextostr('BFF4FAB843FA00000004A2', true)

Your script should probably read:
Code:
result = lmcore.strtohex(data)
log(result)
Reply


Messages In This Thread
Hex manipulation - by buuuudzik - 18.09.2016, 14:35
RE: Hex manipulation - by Erwin van der Zwart - 18.09.2016, 21:31
RE: Hex manipulation - by buuuudzik - 19.09.2016, 12:12
RE: Hex manipulation - by Erwin van der Zwart - 19.09.2016, 12:42
RE: Hex manipulation - by admin - 19.09.2016, 12:44
RE: Hex manipulation - by buuuudzik - 19.09.2016, 13:36
RE: Hex manipulation - by Erwin van der Zwart - 19.09.2016, 15:04
RE: Hex manipulation - by admin - 19.09.2016, 15:07
RE: Hex manipulation - by buuuudzik - 19.09.2016, 16:15

Forum Jump: