Previously, I backported the Lua 5.2 bit32 library to work with Lua 5.1.x. I've just updated the backport to the most recent 5.2.0-beta-rc1 version, so it now includes the new bit32.extract and bit32.replace operations. You can find it here: http://smbolton.com/lua/lbitlib-5.2.0-beta-rc1-backport3.c Have fun, -Sean