A hash function is used to determine if q and k are close.