public void CanCalculateHashCode() { var bytes = new byte[20] { 0x45, 0xa2, 0x21, 0x87, 0xe2, 0xd8, 0x85, 0x0b, 0xb3, 0x57, 0x88, 0x69, 0x58, 0xbc, 0x3e, 0x85, 0x60, 0x92, 0x9c, 0xcc, }; Assert.Equal(465595541, ByteUtil.CalculateHashCode(bytes)); var otherBytes = TestUtils.GetRandomBytes(20); otherBytes[19] = 0xdd; Assert.NotEqual( ByteUtil.CalculateHashCode(bytes), ByteUtil.CalculateHashCode(otherBytes) ); }
public override int GetHashCode() { return(ByteUtil.CalculateHashCode(Signature.ToArray())); }
public override int GetHashCode() => ByteUtil.CalculateHashCode(ToByteArray());
public override int GetHashCode() { return(ByteUtil.CalculateHashCode(_bytes)); }