Class BTPeerIDByteDecoder

java.lang.Object
com.biglybt.core.peermanager.utils.BTPeerIDByteDecoder

public class BTPeerIDByteDecoder extends Object
Used for identifying clients by their peerID.
  • Field Details

    • LOG_UNKNOWN

      static final boolean LOG_UNKNOWN
    • logged_discrepancies

      private static final HashSet logged_discrepancies
    • logger

      private static AEDiagnosticsLogger logger
    • client_logging_allowed

      static boolean client_logging_allowed
    • logged_ids

      private static final HashSet logged_ids
  • Constructor Details

    • BTPeerIDByteDecoder

      public BTPeerIDByteDecoder()
  • Method Details

    • logUnknownClient0

      private static String logUnknownClient0(byte[] peer_id_bytes) throws IOException
      Throws:
      IOException
    • asUTF8ByteString

      private static String asUTF8ByteString(String text)
    • logClientDiscrepancy

      public static void logClientDiscrepancy(String peer_id_name, String handshake_name, String discrepancy, String protocol, byte[] peer_id)
    • logClientDiscrepancyToFile

      private static void logClientDiscrepancyToFile(String line_to_log)
    • logUnknownClient

      static void logUnknownClient(byte[] peer_id_bytes, boolean to_debug_out)
    • logUnknownClient

      static void logUnknownClient(String peer_id, String net)
    • decode0

      public static String decode0(byte[] peer_id_bytes, String net)
    • decode

      public static String decode(byte[] peer_id, String net)
      Decodes the given peerID, returning an identification string.
    • identifyAwkwardClient

      public static String identifyAwkwardClient(byte[] peer_id)
    • decodeBitSpiritClient

      private static String decodeBitSpiritClient(String peer_id, byte[] peer_id_bytes)
    • decodeBitCometClient

      private static String decodeBitCometClient(String peer_id, byte[] peer_id_bytes)
    • getPrintablePeerID

      protected static String getPrintablePeerID(byte[] peer_id)
    • getPrintablePeerID

      protected static String getPrintablePeerID(byte[] peer_id, char fallback_char)
    • makePeerIDReadableAndUsable

      private static String makePeerIDReadableAndUsable(byte[] peer_id)
    • peerIDStringToBytes

      static byte[] peerIDStringToBytes(String peer_id) throws Exception
      Throws:
      Exception
    • assertDecode

      private static void assertDecode(String client_result, String peer_id) throws Exception
      Throws:
      Exception
    • assertDecode

      private static void assertDecode(String client_result, byte[] peer_id) throws Exception
      Throws:
      Exception
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception