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()); }
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); }
/// <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); } }