Package snap.util

Class ASCIICodec

java.lang.Object
snap.util.ASCIICodec

public class ASCIICodec extends Object
This class has utility methods to code and decode into various different formats: hex, ASCII85, base 64.
  • Constructor Details

    • ASCIICodec

      public ASCIICodec()
  • Method Details

    • encodeHex

      public static String encodeHex(byte[] theBytes)
      Returns a hex string for given byte array.
    • decodeHex

      public static byte[] decodeHex(String aString)
      Returns a byte array for given hex string.
    • encodeBase64

      public static String encodeBase64(byte[] theBytes)
      Returns a base64 string for given byte array.
    • decodeBase64

      public static byte[] decodeBase64(String aString)
      Returns a byte array for given base64 string.
    • encodeASCII85

      public static String encodeASCII85(byte[] theBytes)
      Returns an ASCII85 string for given byte array.
    • decodeASCII85

      public static byte[] decodeASCII85(String aString)
      Returns a byte array for given ASCII85 string.