Allow customization of the hash function.

Just an attempt at cross-platform-ness.