Making hash modulus generic