[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bit ops on boolean arrays?
- From: Patrick Rapin <toupie300@...>
- Date: Thu, 30 Dec 2010 20:17:37 +0100
The custom "bit" library I wrote (see [1]) have in fact a feature like that.
It accepts both "number" arguments (treating LSB as bit 0) and
"string" arguments (considering MSB of first byte as bit 0).
It is therefore possible to perform a bitwise AND on two strings of
the same length, or a bit shift of a string.
The drawback is that my speed-optimized implementation is about 5x
bigger than the standard bit32 library...
And I have to admit that I never used that string feature myself (it
was supposed to help creating shingling masks) !
In case someone is nevertheless interested, please just ask.
[1] http://lua-users.org/lists/lua-l/2010-11/msg00669.html