示例#1
0
        public void CompareTrue()
        {
            PrepareHash();

            var leftLeft   = BigEndianConverter.ToUInt64(new Span <byte>(_hashBytes).Slice(0, 8));
            var leftRight  = BigEndianConverter.ToUInt64(new Span <byte>(_hashBytes).Slice(8, 8));
            var rightLeft  = BigEndianConverter.ToUInt64(new Span <byte>(_hashBytes).Slice(16, 8));
            var rightRight = BigEndianConverter.ToUInt64(new Span <byte>(_hashBytes).Slice(24, 8));

            Hash256 toCompare = new Hash256(leftLeft, leftRight, rightLeft, rightRight);

            Assert.Equal(0, _hash.CompareTo(toCompare));
        }
示例#2
0
文件: BlockId.cs 项目: tshhaha/Terab
 public int CompareTo(BlockId other)
 {
     return(_hash.CompareTo(other._hash));
 }