示例#1
0
        /// <summary>
        /// Calculates the hash code for the immutable steckering.
        /// </summary>
        /// <returns>The calculated hash code.</returns>
        private int CalculateHash()
        {
            int hash   = steckering.Length;
            int rotate = 1 + steckering.Length % 31;

            for (int i = 0; i < steckering.Length; i++)
            {
                hash ^= steckering[i];
                hash  = BitRotating.RotateLeft(hash, rotate);
            }
            return(hash);
        }
示例#2
0
        /// <summary>
        /// Calculates the hash code for the immutable steckering.
        /// </summary>
        /// <returns>The calculated hash code.</returns>
        private int CalculateHash()
        {
            int hash   = letters.Length;
            int rotate = 1 + letters.Length % 31;

            for (int i = 0; i < letters.Length; i++)
            {
                hash ^= letters[i];
                hash  = BitRotating.RotateLeft(hash, rotate);
            }
            return(hash);
        }