Version: alpha
FUNCTION | |
---|---|
pprint() | pretty printing |
hash() | hashes a string |
hash_to_hex() | get hex representation of a hash value as a string |
pprint(v)
PARAMETERS
v |
value to print |
EXAMPLES
Pretty printing a Lua table with a nested table:local t2 = { 1, 2, 3, 4 } local t = { key = "value", key2 = 1234, key3 = t2 } pprint(t)
{ key3 = { 1 = 1, 2 = 2, 3 = 3, 4 = 4, } key2 = 1234, key = value, }
hash(s)
PARAMETERS
s |
string to hash |
RETURNS
hash |
a hashed string |
EXAMPLES
To compare a message_id in an on-message callback function:function on_message(self, message_id, message, sender) if message_id == hash("my_message") then -- Act on the message here end end
hash_to_hex(h)
PARAMETERS
h |
hash value to get hex string for |
RETURNS
hex |
hex representation of the hash |
EXAMPLES
local h = hash("my_hash") local hexstr = hash_to_hex(h) print(hexstr) --> a2bc06d97f580aab