Class Base32Encoder

All Implemented Interfaces:
Encoder

public class Base32Encoder extends AbstractBaseNEncoder
Stateful base 32 encoder with support for configurable line breaks.
Author:
Middleware Services
  • Field Summary

    Fields inherited from class org.cryptacular.codec.AbstractBaseNEncoder

    lineLength
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with no line breaks in the output.
    Base32Encoder(int charactersPerLine)
    Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with the given number of characters per line in the output.
    Base32Encoder(int charactersPerLine, boolean paddedOutput)
    Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with the given number of characters per line in the output.
    Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with no line breaks in the output.
    Base32Encoder(String alphabet, int charactersPerLine)
    Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with the given number of characters per line in the output.
    Base32Encoder(String alphabet, int charactersPerLine, boolean paddedOutput)
    Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with the given number of characters per line in the output.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
     
    protected int
     

    Methods inherited from class org.cryptacular.codec.AbstractBaseNEncoder

    encode, encodingTable, finalize, isPaddedOutput, outputSize

    Methods inherited from class java.lang.Object

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

    • Base32Encoder

      public Base32Encoder()
      Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with no line breaks in the output.
    • Base32Encoder

      public Base32Encoder(int charactersPerLine)
      Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with the given number of characters per line in the output.
      Parameters:
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
    • Base32Encoder

      public Base32Encoder(int charactersPerLine, boolean paddedOutput)
      Creates a new instance that produces base 32-encoded output in the RFC 4648 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, with the given number of characters per line in the output.
      Parameters:
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
      paddedOutput - True to enable padded output, false otherwise.
    • Base32Encoder

      public Base32Encoder(String alphabet)
      Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with no line breaks in the output.
      Parameters:
      alphabet - 32-character alphabet to use.
    • Base32Encoder

      public Base32Encoder(String alphabet, int charactersPerLine)
      Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with the given number of characters per line in the output.
      Parameters:
      alphabet - 32-character alphabet to use.
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
    • Base32Encoder

      public Base32Encoder(String alphabet, int charactersPerLine, boolean paddedOutput)
      Creates a new instance that produces base 32-encoded output in the given 32-character alphabet with the given number of characters per line in the output.
      Parameters:
      alphabet - 32-character alphabet to use.
      charactersPerLine - Number of characters per line. A zero or negative value disables line breaks.
      paddedOutput - True to enable padded output, false otherwise.
  • Method Details