83
Converts Lua variable to JSON string. Script execution is stopped in case of an error.
json.pencode (value)
Converts Lua variable to JSON string in protected mode, returns nil on error.
json.decode (value)
Converts JSON string to Lua variable. Script execution is stopped in case of an error.
json.pdecode (value)
Converts JSON string to Lua variable in protected mode, returns nil on error.
6.1.24. Conversion
Compatibility layer:lmcore is an alias of cnv.
cnv.strtohex (str)
Converts given binary string to a hex-encoded string.
cnv.hextostr (hex [, keepnulls])
Converts given hex-encoded string to a binary string. NULL characters are ignored by default,
but can be included by setting second parameter to true.
cnv.tonumber (value)
Converts the given value to number using following rules: numbers and valid numeric strings
are treated as is, boolean true is 1, boolean false is 0, everything else is nil.
cnv.hextoint(hexvalue, bytes)
Converts the given hex string to and integer of a given length in bytes.
cnv.inttohex(intvalue, bytes)
Converts the given integer to a hex string of given bytes.
cnv.strtohex(str)
Converts the given binary string to a hex-encoded string.
cnv.hextostr(hexstr)
Converts the given hex-encoded string to a binary string.
6.1.25. Bit operators
bit.bnot (value)
Binary not