コード例 #1
0
        public override string ToString()
        {
            var result = new StringBuilder();

            result.AppendLine("BuildRequestRecord");
            result.AppendLine("ReceiveTunnel : " + ReceiveTunnel.ToString());
            result.AppendLine("OurIdent      : " + OurIdent.ToString());
            result.AppendLine("NextTunnel    : " + NextTunnel.ToString());
            result.AppendLine("NextIdent     : " + NextIdent.ToString());
            result.AppendLine("Flag          : 0x" + Flag.ToString("X2"));
            result.AppendLine("ToAnyone      : " + ToAnyone.ToString());
            result.AppendLine("FromAnyone    : " + FromAnyone.ToString());
            result.AppendLine("RequestTime   : " + RequestTime.ToString());
            result.AppendLine("SendMessageId : " + SendMessageId.ToString());

            return(result.ToString());
        }
コード例 #2
0
ファイル: BuildRequestRecord.cs プロジェクト: itfenom/i2p-cs
        private uint CreateReducedHash()
        {
            var result = TickCounter.Now.Ticks / 20000;

            if (FromAnyone)
            {
                result ^= NextIdent.GetHashCode();
                return((uint)result);
            }
            else if (ToAnyone)
            {
                result ^= NextIdent.GetHashCode();
                return((uint)result);
            }

            result ^= NextIdent.GetHashCode();
            result ^= NextTunnel.GetHashCode();
            return((uint)result);
        }
コード例 #3
0
        /// <summary>
        /// High probability to match with similar route.
        /// </summary>
        /// <returns></returns>
        public uint GetReducedHash()
        {
            if (FromAnyone)
            {
                var result = ReceiveTunnel.GetHashCode();
                result ^= NextIdent.GetHashCode();
                return((uint)result);
            }
            else if (ToAnyone)
            {
                var result = ReceiveTunnel.GetHashCode();
                result ^= NextIdent.GetHashCode();
                return((uint)result);
            }

            {
                var result = ReceiveTunnel.GetHashCode();
                result ^= NextIdent.GetHashCode();
                result ^= NextTunnel.GetHashCode();
                return((uint)result);
            }
        }