BitSharp.Core.Test.Miner.BytesCompareLE C# (CSharp) Method

BytesCompareLE() private static method

private static BytesCompareLE ( byte a, byte b ) : int
a byte
b byte
return int
        private static int BytesCompareLE(byte[] a, byte[] b)
        {
            if (a.Length != b.Length)
                throw new ArgumentException();

            for (var i = a.Length - 1; i >= 0; i--)
            {
                if (a[i] < b[i])
                    return -1;
                else if (a[i] > b[i])
                    return +1;
            }

            return 0;
        }
    }