I would like to get a hash in a native extension function. I am passing the hash as an argument to the C function. But it seems that I always get 0. If I print the hex value of the hash in lua just before calling the c function I get:
fd99e8b1e3ff9e17
that looks as a valid value to me.
But when I try to get the value in C with the lines
uint64_t h = lua_tointeger(L, HASH_INDEX);
printf(“hash = %llu\n”, h);
I always get 0.
Maybe lua_tointeger is not the right way to get a hash from the stack? It seems to me that hash are 64 bit unsigned int and that also lua_tointeger returns a 64 bit unsigned int.
Any help is highly apreciated!
Thank you!