java.lang.Object
i2p.susi.util.HexTable

public class HexTableextends Object
Hex table utilities for byte-to-string conversion.
  • Field Details

    • table

      public static final String[] table
      Three character strings, upper case, e.g. "=0A" WARNING: This array is public for backward compatibility but should be treated as immutable.
  • Constructor Details

    • HexTable

      public HexTable()
      Constructor. The lookup table is built once in the static initializer, so an instance holds nothing.
  • Method Details

    • getHexString

      public static String getHexString(int b)
      Get hex string for the given byte value.
      Parameters:
      b - byte value (0-255)
      Returns:
      hex string, e.g. "=0A"
    • getTableEntry

      public static String getTableEntry(int index)
      Direct access to table entry for backward compatibility.
      Parameters:
      index - a byte value between 0 and 255
      Returns:
      hex string at that index
    • getTable

      public static String[] getTable()
      Get a copy of the hex table for safe access.
      Returns:
      a copy of the hex table array
    • intToHex

      private static String intToHex(int b)
      Convert an integer to its hexadecimal string representation.
      Parameters:
      b - the value (0-255)
      Returns:
      the hex string without leading zeros