's bl.aagh

BSD, Ruby, Rust, Rambling

🖩 Bloom Filter Calculator 🖩

It has, like, graphs, and stuff.

[php] [javascript] [web]

Bloom filters are one of my favourite data structures, in no small part because of just how simple they are.

I first encountered them when I worked at Newzbin, when we needed a way of quickly determining if we’d seen a Usenet Message-ID before.

Their simplicity meant we were very quickly able to go from concept to a stable general-purpose microservice which served us well for many years.

One of the trickier aspects is knowing how to size one - typically you know how many items and what sort of false-positive rate you can stand, but how do you translate that to how many bits you need and how many hash functions to use?

Well, bam. The latest iteration of my calculator can calculate almost any valid set of parameters, and give you pretty graphs in real time, while offering server-side fallback. I hope you find it useful.


PHP's serialize()/unserialize() in Ruby

[ruby] [php]

Many, many years ago, I wrote this for unclear reasons. I don’t think I actually used it for anything. It implements the PHP serialize() and unserialize() functions in Ruby, allowing you to read/write PHP sessions and otherwise share objects between the two.

Now the various forks of it have nearly half a million downloads between them. php-serialize is the “official” version, with nearly half of those.

The exact incept date is uncertain, the earliest mention of it a quick search finds is ruby-talk:73669, 2003-06-16.