A python port of https://github.com/pda/flexihash , aiming for 1:1 compatibility