Exemplo n.º 1
0
        public CompositeShardingID(params object[] data)
        {
            if (data == null || data.Length == 0)
            {
                throw new DataAccessException(StringConsts.ARGUMENT_ERROR + "CompositeShardingID.ctor(data==null|empty)");
            }

            m_Data = data;

            m_HashCode = 0ul;

            for (var i = 0; i < m_Data.Length; i++)
            {
                var elm = m_Data[i];

                ulong ehc;

                if (elm != null)
                {
                    ehc = ShardingUtils.ObjectToShardingID(elm);
                }
                else
                {
                    ehc = 0xaa018055ul;
                }

                m_HashCode <<= 1;
                m_HashCode  ^= ehc;
            }
        }
Exemplo n.º 2
0
 public ulong GetDistributedStableHash() => (System.GetDistributedStableHash() << 32) ^
 Type.GetDistributedStableHash() ^
 ShardingUtils.StringToShardingID(Address);