lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I need to xor a couple of 64 bit long integers, specifically to seed a
pseudo-random number generator with a combination of a couple of
values. However, the bit library does not appear to support cdata
objects. I could truncate the integer and convert it to a Lua number
then use the bit library on it, but I would rather have the full range
of a long for the seed. I could also implement the bitwise methods
inside of a C library and load it via FFI, but that means another DLL
I have to load and another C file to take care of, and probably a
performance hit too. So I ask, is there a way to preform bitwise
operations on 64 bit integers in native LuaJIT, and if so, how? Or if
not, is it planned and when can I expect it?

Thanks, Alex.