Пример #1
0
        public void GetHashCodeTest()
        {
            var hash = Key.Create().PubKey.Hash.ToByteArray();
            var id   = new KeyId(hash);

            Assert.AreEqual(hash.GetHashCode(), id.GetHashCode());
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (PublicKey.Length != 0)
            {
                hash ^= PublicKey.GetHashCode();
            }
            if (Signature.Length != 0)
            {
                hash ^= Signature.GetHashCode();
            }
            if (KeyId.Length != 0)
            {
                hash ^= KeyId.GetHashCode();
            }
            if (KeyType != 0)
            {
                hash ^= KeyType.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (KeyId.Length != 0)
            {
                hash ^= KeyId.GetHashCode();
            }
            if (Status != global::Yandex.Cloud.Kms.V1.SymmetricKeyVersion.Types.Status.Unspecified)
            {
                hash ^= Status.GetHashCode();
            }
            if (Algorithm != global::Yandex.Cloud.Kms.V1.SymmetricAlgorithm.Unspecified)
            {
                hash ^= Algorithm.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            if (Primary != false)
            {
                hash ^= Primary.GetHashCode();
            }
            if (destroyAt_ != null)
            {
                hash ^= DestroyAt.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #4
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.version)
            {
                hashcode = (hashcode * 397) + Version.GetHashCode();
            }
            if (__isset.keyId)
            {
                hashcode = (hashcode * 397) + KeyId.GetHashCode();
            }
            if (__isset.keyData)
            {
                hashcode = (hashcode * 397) + KeyData.GetHashCode();
            }
            if (__isset.createdTime)
            {
                hashcode = (hashcode * 397) + CreatedTime.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #5
0
 public override int GetHashCode()
 {
     return(KeyId.GetHashCode());
 }