Page 1 of 1

Works fine with LuaJIT but not with standard

Posted: Wed Nov 13, 2013 3:33 am
by Bicentric
-

Re: Works fine with LuaJIT but not with standard

Posted: Wed Nov 13, 2013 4:55 am
by Boolsheet
The library you have chosen does not have pure-Lua bitwise functions.

Code: Select all

-- TODO: implement bit ops in Lua
You can try my hash.lua that implements some hashes. It also requires my utils.lua and bit.lua for the pure-Lua functions.

Re: Works fine with LuaJIT but not with standard

Posted: Wed Nov 13, 2013 4:58 am
by Roland_Yonaba
Hi,
The standard version of Löve uses Lua5.1, which does not have a bit library.
LoveJIT uses LuaJIT, which already implements a bitOp module (written in C and provinding functions such as bit.band, bit.bor, bit.ror, ...).
In case you need to run the same code with standard Love, you will have to implement a bitwise op library in a file named bit.lua, so that it'll be called by LuaCrypt. Hopefully, pure Lua implementations of bitwise operations is available. Checkout David Manura's.

EDIT: Ninja'ed by BoolSheet.