Class Base16Utils

java.lang.Object
craterdog.utils.Base16Utils

public final class Base16Utils extends Object
This utility class provides functions for encoding and decoding byte arrays using base 16. The character set used for the encoding includes the following characters: 0..9 A..F
Author:
Derk Norton
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    decode(String base16)
    This function decodes a base 16 string into its corresponding byte array.
    static String
    encode(byte[] bytes)
    This function encodes a byte array using base 16 with no indentation of new lines.
    static String
    encode(byte[] bytes, String indentation)
    This function encodes a byte array using base 16 with a specific indentation of new lines.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • encode

      public static String encode(byte[] bytes)
      This function encodes a byte array using base 16 with no indentation of new lines.
      Parameters:
      bytes - The byte array to be encoded.
      Returns:
      The base 16 encoded string.
    • encode

      public static String encode(byte[] bytes, String indentation)
      This function encodes a byte array using base 16 with a specific indentation of new lines.
      Parameters:
      bytes - The byte array to be encoded.
      indentation - The indentation string to be inserted before each new line.
      Returns:
      The base 16 encoded string.
    • decode

      public static byte[] decode(String base16)
      This function decodes a base 16 string into its corresponding byte array.
      Parameters:
      base16 - The base 16 encoded string.
      Returns:
      The corresponding byte array.