Seeing the mention of the bit plugin in the most recent public release, a link or two may be handy.
This is quite a good list, especially the two “resources” parts, and looks to be an interesting page in its own right (only just discovered it myself):
http://chessprogramming.wikispaces.com/Bit-Twiddling
In particular, http://graphics.stanford.edu/~seander/bithacks.html and http://www.hackersdelight.org/basics1.pdf are great starting points and seem to complement one another well.
Bob Jenkins has a lot of material too, though one might have to sift a bit: http://burtleburtle.net/bob/hash/
I have some (useful?) Lua examples of my own:
https://github.com/ggcrunchy/LittleGreenMen/blob/master/utils.lua Not Corona (rather, LuaJIT + ANGLE), but a couple functions should be portable. CLP2 (ceiling log power of 2) might be useful to some… it rounds up to the next power of 2. Although not exactly well-documented otherwise, the 3-value Morton numbers have comments next to them showing how the bits get spread out during the interleave, showing where the “magic” numbers originate.
https://github.com/ggcrunchy/LittleGreenMen/blob/master/ray_slopes.lua Another one from the same project (unfortunately not as portable) with comments explaining (probably not well…) how a bunch of tests got converted into bitmasks / lookup tables.
I don’t know that there’s any reasonable way to incorporate them. But those ideas / methods are good to know… maybe future tutorial material?
https://github.com/ggcrunchy/corona-sdk-snippets/blob/master/bitwise_ops.lua A few Corona utilities (this one actually has some improvements coming, once I bring them in from another project) built on bitwise ops, including stuff from the above-mentioned Bit Twiddling Hacks and Hacker’s Delight.
Here and elsewhere in the SDK snippets project, I kludged my way around not having bit ops (if curious, search for files that do
local has\_bit, bit = pcall(require, "bit") -- Prefer BitOp
up front; some of those cases ought to be more elegant now that there’s support), but maybe some ideas can be gleaned anyhow.