Esempio n. 1
0
        /// <summary>
        /// Determines whether the first byte array is smaller than the second one.
        /// </summary>
        /// <param name="v1">The first byte array to compare.</param>
        /// <param name="v2">The second byte array to compare.</param>
        /// <param name="orEqual">If true, then the operator is less or equal to.</param>
        public static bool IsLess(Byte[] v1, Byte[] v2, bool orEqual = false)
        {
            if (orEqual)
            {
                return(Comparers.ByteArrayComparer(v1, v2) <= 0);
            }

            return(Comparers.ByteArrayLessThan(v1, v2));
        }
Esempio n. 2
0
        /// <summary>
        /// Determines whether the first byte array is smaller than the second one.
        /// </summary>
        /// <param name="v1">The first byte array to compare.</param>
        /// <param name="v2">The second byte array to compare.</param>
        /// <param name="orEqual">If true, then the operator is less or equal to.</param>
        public static bool IsGreater(Byte[] v1, Byte[] v2, bool orEqual = false)
        {
            if (orEqual)
            {
                return(Comparers.ByteArrayComparer(v1, v2) >= 0);
            }

            return(Comparers.ByteArrayGreaterThan(v1, v2));
        }
Esempio n. 3
0
 /// <summary>
 /// Compares two specified values and returns an integer that indicates their relative position in the sort order.
 /// </summary>
 /// <param name="x">The first string to compare.</param>
 /// <param name="y">The second string to compare.</param>
 public int Compare(byte[] x, byte[] y)
 {
     return(Comparers.ByteArrayComparer(x, y));
 }