Class Base32Utils

java.lang.Object
craterdog.utils.Base32Utils

public final class Base32Utils extends Object
This utility class provides functions for encoding and decoding byte arrays using base 32. The character set used for the encoding includes the following characters: 0..9 A..D F..H J..N P..T V..Z
Author:
Derk Norton
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    decode(String base32)
    This function decodes a base 32 string into its corresponding byte array.
    static String
    encode(byte[] bytes)
    This function encodes a byte array using base 32 with no indentation of new lines.
    static String
    encode(byte[] bytes, String indentation)
    This function encodes a byte array using base 32 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 32 with no indentation of new lines.
      Parameters:
      bytes - The byte array to be encoded.
      Returns:
      The base 32 encoded string.
    • encode

      public static String encode(byte[] bytes, String indentation)
      This function encodes a byte array using base 32 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 32 encoded string.
    • decode

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