Example #1
0
        public static int GetHashCode(byte[] bytes, int offset, int count)
        {
            if (Is32Bit)
            {
                return(unchecked ((int)FarmHash.Hash32(bytes, offset, count)));
            }

            return(unchecked ((int)FarmHash.Hash64(bytes, offset, count)));
        }
        private static ulong ByteArrayGetHashCode(byte[] x, int offset, int count)
        {
            // FarmHash https://github.com/google/farmhash
            if (x == null || x.Length == 0 || count == 0)
            {
                return(0);
            }

            return(ByteArrayStringHashTableStatics.Is32Bit
                                ? FarmHash.Hash32(x, offset, count)
                                : FarmHash.Hash64(x, offset, count));
        }