Python: Adding Golomb coding for EV whitelist.

Golomb coding hashes the fixed 8-bytes EV cert hashes by 20%.
I don't get this.  "M is a power of 2" is equivalent to "M has just 1 bit set".  I don't know much about Python, but in C this is traditionally done as:

((x != 0) && !(x & (x - 1)))

Using floats to do this smells.