コード例 #1
0
        public override long GetLongHashCode(ReadOnlyMemory <char> value)
        {
            if (value.IsEmpty)
            {
                return(0);
            }

            var(h1, h2) = NonRandomLongStringComparer.Hash(value.Span);
            return((long)(h1 | (ulong)h2 << 32));
        }
コード例 #2
0
        public override int GetHashCode(ReadOnlyMemory <char> value)
        {
            if (value.IsEmpty)
            {
                return(0);
            }

            var(h1, h2) = NonRandomLongStringComparer.Hash(value.Span);
            return((int)(h1 + (h2 * 1566083941)));
        }