Class Base32Codec

java.lang.Object
org.cryptacular.codec.Base32Codec
All Implemented Interfaces:
Codec

public class Base32Codec extends Object implements Codec
Base 32 encoder/decoder pair.
Author:
Middleware Services
  • Constructor Details

    • Base32Codec

      public Base32Codec()
      Creates a new instance using the RFC 4328 alphabet, ABCDEFGHIJKLMNOPQRSTUVWXYZ234567.
    • Base32Codec

      public Base32Codec(String alphabet)
      Creates a new instance using the given 32-character alphabet.
      Parameters:
      alphabet - 32-character alphabet to use.
    • Base32Codec

      public Base32Codec(String alphabet, boolean inputOutputPadding)
      Creates a new instance using the given 32-character alphabet with option to enable/disable padding.
      Parameters:
      alphabet - 32-character alphabet to use.
      inputOutputPadding - True to enable support for padding, false otherwise.
  • Method Details

    • getEncoder

      public Encoder getEncoder()
      Specified by:
      getEncoder in interface Codec
      Returns:
      The byte-to-char encoder of the codec pair.
    • getDecoder

      public Decoder getDecoder()
      Specified by:
      getDecoder in interface Codec
      Returns:
      The char-to-byte decoder of the codec pair.
    • newEncoder

      public Encoder newEncoder()
      Specified by:
      newEncoder in interface Codec
      Returns:
      A new instance of the byte-to-char encoder of the codec pair.
    • newDecoder

      public Decoder newDecoder()
      Specified by:
      newDecoder in interface Codec
      Returns:
      A new instance of the char-to-byte decoder of the codec pair.