Beispiel #1
0
        public static unsafe int HashCodeAscii(byte[] bytes, int startPos, int length)
        {
            if (length == 0)
            {
                return(HashCodeAsciiSeed);
            }

            fixed(byte *array = &bytes[startPos])
            return(PlatformDependent0.HashCodeAscii(array, length));
        }
Beispiel #2
0
        public static unsafe bool ByteArrayEquals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
        {
            if (length <= 0)
            {
                return(true);
            }

            fixed(byte *array1 = &bytes1[startPos1])
            fixed(byte *array2 = &bytes2[startPos2])
            return(PlatformDependent0.ByteArrayEquals(array1, array2, length));
        }
Beispiel #3
0
        public static unsafe int ByteArrayEqualsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length)
        {
            if ((uint)(length - 1) > SharedConstants.TooBigOrNegative) // <= 0
            {
                return(1);
            }

            fixed(byte *array1 = bytes1)
            fixed(byte *array2 = bytes2)
            return(PlatformDependent0.ByteArrayEqualsConstantTime(array1, startPos1, array2, startPos2, length));
        }