Simple hash implementation.