Class HexaDecimal

java.lang.Object
org.webpki.util.HexaDecimal

public class HexaDecimal extends Object
Encodes/decodes hexadecimal data.
  • Method Details

    • getHexDebugData

      public static String getHexDebugData(byte[] byteArray, int bytesPerLine)
      Formats byte array data into readable lines.

      After each line (nn: hh hh...) the ASCII counterpart is listed as well.

      Parameters:
      byteArray - The data to be listed
      bytesPerLine - Bytes per line
      Returns:
      Human-readable String
    • encode

      public static String encode(byte[] byteArray)
      Encodes byte array data.
      Parameters:
      byteArray - Data to be encoded
      Returns:
      String with zero or more hexadecimal pairs (hh)
    • decode

      public static byte[] decode(String hexString)
      Decodes a hexadecimal String.
      Parameters:
      hexString - String with zero or more hexadecimal pairs (hh)
      Returns:
      byteArray