[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bloom filters.
- From: Jorge <xxopxe@...>
- Date: Fri, 10 Jan 2014 14:35:16 -0200
On 01/10/2014 02:05 PM, Philipp Janda wrote:
http://lua.2524044.n2.nabble.com/bloom-filter-td7611346.html
A nice piece of code, actually. The bitset is a table mapping positive
integer keys to boolean values, but instead of just using
...
Great explanation, thanks! Now I get it. I think I was confused by the
"packbits" word, I thought it was some kind of RLE compression.
Now you just need to figure out how to do a bitwise "or" of two 52-bit
wide numbers in Lua (you can probably reuse some code from the `test`
function) ...
I think I have some code around for bitwise operations...
How do you hash arbitrary Lua values (e.g. tables) from within Lua? Or
do you limit yourself to certain keys? I thought about implementing
Bloom filters for fun not long ago, but I couldn't figure out how to
hash a table value (or userdata, etc.) from within Lua ...
Luckily, I only have to store strings (unique identifiers). Also, out of
lack of imagination I used CRC32 as hash function, not sure a good match.
If you need to store arbitrary data, I guess it turns into a
serialization problem.
I uploaded my code at https://github.com/xopxe/bloomini . Notice how I
left the lua-bloom project name available ;-)
Thanks again for the help,
Jorge