Added hash algorithm for QState.