示例#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)));
        }
示例#2
0
        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(Is32Bit
                                ? FarmHash.Hash32(x, offset, count)
                                : FarmHash.Hash64(x, offset, count));
        }