Class HexCodec

java.lang.Object
io.sf.jclf.util.HexCodec

public class HexCodec extends Object
An hexadecimal encoder/decoder.
  • Constructor Details

    • HexCodec

      public HexCodec()
  • Method Details

    • encode

      public static String encode(byte[] b)
      Hex encode this array using lowercase letters.
      Parameters:
      b - the byte array to be encoded.
      Returns:
      the hex-encoded array.
    • encodeU

      public static String encodeU(byte[] b)
      Hex encode this array using uppercase letters.
      Parameters:
      b - the byte array to be encoded.
      Returns:
      the hex-encoded (with uppercase letters) array.
    • decode

      public static byte[] decode(String h)
      Hex decode this String.
      Parameters:
      h - the String to be decoded.
      Returns:
      the hex-decoded array.