ArrayIndex DynamicHashArray::CalculateHash(AccountNumber p_Key) { unsigned long Result; unsigned long HashNumber = 0; unsigned long TempHash = 0; ArrayIndex AccountNumberLength; AccountNumberLength = p_Key.GetSize(); for (ArrayIndex i = 0; i < AccountNumberLength; i ++) { HashNumber <<= 3; HashNumber += p_Key[i] & 7; } HashNumber %= 1048583L; Result = HashNumber & (m_CurrentMaxSlotCount-1); if (Result >= m_CurrentSlotCount) Result -= m_CurrentMaxSlotCount/2; return (ArrayIndex)Result; }