public override string ToString() { var sb = new StringBuilder(); if (AddressType != 3) { var addressBytes = Address; if (AddressType != 2) { addressBytes = (new ArraySegment <byte>(Address, 0, 4)).ToArray(); } IPAddress addr = new IPAddress(addressBytes); sb.AppendFormat("Redirected to: {0}:{1}", addr.ToString(), Port); sb.AppendLine(); sb.AppendFormat("Xor magic: {0}", XorMagic); sb.AppendLine(); sb.AppendFormat("Pi digits: {0}", Program.ByteArrayToHexString(PiDigits)); sb.AppendLine(); if (PanamaKey != null) { sb.AppendFormat("Panama seed: {0}", Program.ByteArrayToHexString(PanamaKey)); sb.AppendLine(); } if (Adler32 != 0) { sb.AppendFormat("Adler32: {0}", Adler32.ToString("X8")); sb.AppendLine(); } sb.AppendFormat(Encoding.ASCII.GetString(Haiku)); sb.AppendLine(); sb.AppendLine("HMAC: " + Program.ByteArrayToHexString(Hmac)); } return(sb.ToString()); }