How to properly get and use hash in native extensions?


#1

This seems to works:

auto key = *(uint64_t *)luaL_checkudata(L, narg, "hash");

Will this work in debug and release builds?
How to get string from hash in debug builds?


#2

Did you try dmHashString64 https://www.defold.com/ref/dmHash/#dmHashString64:string ?


#3

“calculate 64-bit hash value from string”
This is not what I want. I need an opposite: hash -> source string.
I heard this is possible in debug builds and want to know how to do that.


#4

Have you tried tostring(my_hash)? I can’t check right now, but I think that might return what you need.