jasondavies / bloomfilter.js

JavaScript bloom filter using FNV for fast hashing
http://www.jasondavies.com/bloomfilter/
BSD 3-Clause "New" or "Revised" License
759 stars 79 forks source link

fnv-plus #10

Closed tjwebb closed 10 years ago

tjwebb commented 10 years ago

Hey I ran across your project as I was researching bloom filters, and I noticed this on your website: "Unfortunately I can't use the 64-bit trick in the linked post as JavaScript only supports bitwise operations on 32 bits."

I don't know if you'd be interested in this, but a little while ago I wrote a version of fnv with an expanded keyspace (up to 1024-bit): https://github.com/tjwebb/fnv-plus.

jasondavies commented 10 years ago

Thanks, but I already perform a simple optimisation to generate the second 32-bit hash: simply run one additional iteration of FNV on the first hash. Admittedly, I haven’t done any in-depth analysis on this step. It might be preferable to seed the second step using some input bits, for example.

tjwebb commented 10 years ago

Yea; the main advantage would just be if you wanted to support >32-bit keyspace